我刚刚将 Xcode升级到4.5版,但是我现在在尝试在iPhone上运行时遇到此错误:
target specifies product type 'com.apple.product-type.application',but there's no such product type for the 'iphoneos' platform

它在模拟器上工作正常,它曾用于4.4版本.

解决方法

您可能从XCode规范中丢失了应用程序部分

退出XCode并转到(对于MacAppStore中的Xcode):

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Specifications/

在编辑之前备份这两个文件:iPhoneOSPackageTypes.xcspec iPhoneOSProductTypes.xcspec

将此内容覆盖到iPhoneOSPackageTypes.xcspec

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
    <key>DefaultBuildSettings</key>
    <dict>
        <key>CONTENTS_FOLDER_PATH</key>
        <string>$(WRAPPER_NAME)</string>
        <key>DOCUMENTATION_FOLDER_PATH</key>
        <string>$(LOCALIZED_RESOURCES_FOLDER_PATH)/Documentation</string>
        <key>EXECUTABLES_FOLDER_PATH</key>
        <string>$(CONTENTS_FOLDER_PATH)/Executables</string>
        <key>EXECUTABLE_FOLDER_PATH</key>
        <string>$(CONTENTS_FOLDER_PATH)</string>
        <key>EXECUTABLE_NAME</key>
        <string>$(EXECUTABLE_PREFIX)$(PRODUCT_NAME)$(EXECUTABLE_VARIANT_SUFFIX)$(EXECUTABLE_SUFFIX)</string>
        <key>EXECUTABLE_PATH</key>
        <string>$(EXECUTABLE_FOLDER_PATH)/$(EXECUTABLE_NAME)</string>
        <key>EXECUTABLE_PREFIX</key>
        <string></string>
        <key>EXECUTABLE_SUFFIX</key>
        <string></string>
        <key>FRAMEWORKS_FOLDER_PATH</key>
        <string>$(CONTENTS_FOLDER_PATH)/Frameworks</string>
        <key>INFOPLIST_PATH</key>
        <string>$(CONTENTS_FOLDER_PATH)/Info.plist</string>
        <key>INFOSTRINGS_PATH</key>
        <string>$(LOCALIZED_RESOURCES_FOLDER_PATH)/InfoPlist.strings</string>
        <key>JAVA_FOLDER_PATH</key>
        <string>$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Java</string>
        <key>LOCALIZED_RESOURCES_FOLDER_PATH</key>
        <string>$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/$(DEVELOPMENT_LANGUAGE).lproj</string>
        <key>PBDEVELOPMENTPLIST_PATH</key>
        <string>$(CONTENTS_FOLDER_PATH)/pbdevelopment.plist</string>
        <key>PKGINFO_PATH</key>
        <string>$(CONTENTS_FOLDER_PATH)/PkgInfo</string>
        <key>PLUGINS_FOLDER_PATH</key>
        <string>$(CONTENTS_FOLDER_PATH)/PlugIns</string>
        <key>PRIVATE_HEADERS_FOLDER_PATH</key>
        <string>$(CONTENTS_FOLDER_PATH)/PrivateHeaders</string>
        <key>PUBLIC_HEADERS_FOLDER_PATH</key>
        <string>$(CONTENTS_FOLDER_PATH)/Headers</string>
        <key>SCRIPTS_FOLDER_PATH</key>
        <string>$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Scripts</string>
        <key>SHALLOW_BUNDLE</key>
        <string>YES</string>
        <key>SHARED_FRAMEWORKS_FOLDER_PATH</key>
        <string>$(CONTENTS_FOLDER_PATH)/SharedFrameworks</string>
        <key>SHARED_SUPPORT_FOLDER_PATH</key>
        <string>$(CONTENTS_FOLDER_PATH)/SharedSupport</string>
        <key>UNLOCALIZED_RESOURCES_FOLDER_PATH</key>
        <string>$(CONTENTS_FOLDER_PATH)</string>
        <key>VERSIONPLIST_PATH</key>
        <string>$(CONTENTS_FOLDER_PATH)/version.plist</string>
        <key>WRAPPER_NAME</key>
        <string>$(WRAPPER_PREFIX)$(PRODUCT_NAME)$(WRAPPER_SUFFIX)</string>
        <key>WRAPPER_PREFIX</key>
        <string></string>
        <key>WRAPPER_SUFFIX</key>
        <string>.bundle</string>
    </dict>
    <key>Description</key>
    <string>Wrapper</string>
    <key>Identifier</key>
    <string>com.apple.package-type.wrapper</string>
    <key>Name</key>
    <string>Wrapper</string>
    <key>ProductReference</key>
    <dict>
        <key>FileType</key>
        <string>wrapper.cfbundle</string>
        <key>IsLaunchable</key>
        <string>NO</string>
        <key>Name</key>
        <string>$(WRAPPER_NAME)</string>
    </dict>
    <key>Type</key>
    <string>PackageType</string>
</dict>
<dict>
    <key>BasedOn</key>
    <string>com.apple.package-type.wrapper</string>
    <key>DefaultBuildSettings</key>
    <dict>
        <key>GENERATE_PKGINFO_FILE</key>
        <string>YES</string>
    </dict>
    <key>Description</key>
    <string>Application Wrapper</string>
    <key>Identifier</key>
    <string>com.apple.package-type.wrapper.application</string>
    <key>Name</key>
    <string>Application Wrapper</string>
    <key>ProductReference</key>
    <dict>
        <key>FileType</key>
        <string>wrapper.application</string>
        <key>IsLaunchable</key>
        <string>YES</string>
        <key>Name</key>
        <string>$(WRAPPER_NAME)</string>
    </dict>
    <key>Type</key>
    <string>PackageType</string>
</dict>
<dict>
    <key>BasedOn</key>
    <string>com.apple.package-type.wrapper</string>
    <key>DefaultBuildSettings</key>
    <dict>
        <key>CONTENTS_FOLDER_PATH</key>
        <string>$(WRAPPER_NAME)/Contents</string>
        <key>DOCUMENTATION_FOLDER_PATH</key>
        <string>$(LOCALIZED_RESOURCES_FOLDER_PATH)</string>
        <key>EXECUTABLES_FOLDER_PATH</key>
        <string>$(CONTENTS_FOLDER_PATH)</string>
        <key>EXECUTABLE_FOLDER_PATH</key>
        <string>$(CONTENTS_FOLDER_PATH)</string>
        <key>FRAMEWORKS_FOLDER_PATH</key>
        <string>$(CONTENTS_FOLDER_PATH)</string>
        <key>INFOPLIST_PATH</key>
        <string>$(WRAPPER_NAME)/ContentInfo.plist</string>
        <key>INFOSTRINGS_PATH</key>
        <string>$(LOCALIZED_RESOURCES_FOLDER_PATH)/ContentInfo.strings</string>
        <key>JAVA_FOLDER_PATH</key>
        <string>$(UNLOCALIZED_RESOURCES_FOLDER_PATH)</string>
        <key>LOCALIZED_RESOURCES_FOLDER_PATH</key>
        <string>$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/$(DEVELOPMENT_LANGUAGE).lproj</string>
        <key>PLUGINS_FOLDER_PATH</key>
        <string>$(CONTENTS_FOLDER_PATH)</string>
        <key>PRIVATE_HEADERS_FOLDER_PATH</key>
        <string>$(CONTENTS_FOLDER_PATH)</string>
        <key>PUBLIC_HEADERS_FOLDER_PATH</key>
        <string>$(CONTENTS_FOLDER_PATH)</string>
        <key>SCRIPTS_FOLDER_PATH</key>
        <string>$(UNLOCALIZED_RESOURCES_FOLDER_PATH)</string>
        <key>SHARED_FRAMEWORKS_FOLDER_PATH</key>
        <string>$(CONTENTS_FOLDER_PATH)</string>
        <key>SHARED_SUPPORT_FOLDER_PATH</key>
        <string>$(CONTENTS_FOLDER_PATH)</string>
        <key>UNLOCALIZED_RESOURCES_FOLDER_PATH</key>
        <string>$(CONTENTS_FOLDER_PATH)</string>
        <key>WRAPPER_SUFFIX</key>
        <string></string>
    </dict>
    <key>Description</key>
    <string>in-app Purchase Content</string>
    <key>Identifier</key>
    <string>com.apple.package-type.in-app-purchase-content</string>
    <key>Name</key>
    <string>in-app Purchase Content</string>
    <key>ProductReference</key>
    <dict>
        <key>FileType</key>
        <string>folder</string>
        <key>IsLaunchable</key>
        <string>NO</string>
        <key>Name</key>
        <string>$(WRAPPER_NAME)</string>
    </dict>
    <key>Type</key>
    <string>PackageType</string>
</dict>
<dict>
    <key>DefaultBuildSettings</key>
    <dict>
        <key>EXECUTABLE_NAME</key>
        <string>$(EXECUTABLE_PREFIX)$(PRODUCT_NAME)$(EXECUTABLE_VARIANT_SUFFIX)$(EXECUTABLE_SUFFIX)</string>
        <key>EXECUTABLE_PATH</key>
        <string>$(EXECUTABLE_NAME)</string>
        <key>EXECUTABLE_PREFIX</key>
        <string>lib</string>
        <key>EXECUTABLE_SUFFIX</key>
        <string>.a</string>
    </dict>
    <key>Description</key>
    <string>Mach-O static library</string>
    <key>Identifier</key>
    <string>com.apple.package-type.static-library</string>
    <key>Name</key>
    <string>Mach-O Static Library</string>
    <key>ProductReference</key>
    <dict>
        <key>FileType</key>
        <string>archive.ar</string>
        <key>IsLaunchable</key>
        <string>NO</string>
        <key>Name</key>
        <string>$(EXECUTABLE_NAME)</string>
    </dict>
    <key>Type</key>
    <string>PackageType</string>
</dict>
</array>
</plist>

以及iPhoneOSProductTypes.xcspec的内容

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
    <key>Class</key>
    <string>PBXBundleProductType</string>
    <key>DefaultBuildProperties</key>
    <dict>
        <key>FRAMEWORK_FLAG_PREFIX</key>
        <string>-framework</string>
        <key>FULL_PRODUCT_NAME</key>
        <string>$(WRAPPER_NAME)</string>
        <key>GCC_INLInes_ARE_PRIVATE_EXTERN</key>
        <string>YES</string>
        <key>LIBRARY_FLAG_NOSPACE</key>
        <string>YES</string>
        <key>LIBRARY_FLAG_PREFIX</key>
        <string>-l</string>
        <key>MACH_O_TYPE</key>
        <string>mh_bundle</string>
        <key>STRIP_STYLE</key>
        <string>non-global</string>
        <key>WRAPPER_EXTENSION</key>
        <string>bundle</string>
        <key>WRAPPER_NAME</key>
        <string>$(WRAPPER_PREFIX)$(PRODUCT_NAME)$(WRAPPER_SUFFIX)</string>
        <key>WRAPPER_PREFIX</key>
        <string></string>
        <key>WRAPPER_SUFFIX</key>
        <string>.$(WRAPPER_EXTENSION)</string>
    </dict>
    <key>DefaultTargetName</key>
    <string>Bundle</string>
    <key>Description</key>
    <string>Generic bundle</string>
    <key>HasInfoPlist</key>
    <string>YES</string>
    <key>HasInfoPlistStrings</key>
    <string>YES</string>
    <key>IconNamePrefix</key>
    <string>TargetPlugin</string>
    <key>Identifier</key>
    <string>com.apple.product-type.bundle</string>
    <key>IsWrapper</key>
    <string>YES</string>
    <key>Name</key>
    <string>Bundle</string>
    <key>PackageTypes</key>
    <array>
        <string>com.apple.package-type.wrapper</string>
    </array>
    <key>Type</key>
    <string>ProductType</string>
</dict>
<dict>
    <key>BasedOn</key>
    <string>com.apple.product-type.bundle</string>
    <key>Class</key>
    <string>PBXApplicationProductType</string>
    <key>DefaultBuildProperties</key>
    <dict>
        <key>CODE_SIGNING_ALLOWED</key>
        <string>YES</string>
        <key>ENTITLEMENTS_ALLOWED</key>
        <string>YES</string>
        <key>GCC_INLInes_ARE_PRIVATE_EXTERN</key>
        <string>YES</string>
        <key>GCC_SYMBOLS_PRIVATE_EXTERN</key>
        <string>YES</string>
        <key>INSTALL_PATH</key>
        <string>$(LOCAL_APPS_DIR)</string>
        <key>MACH_O_TYPE</key>
        <string>mh_execute</string>
        <key>PROVISIONING_PROFILE_required</key>
        <string>YES</string>
        <key>RESOURCE_RULES_required</key>
        <string>YES</string>
        <key>STRIP_STYLE</key>
        <string>all</string>
        <key>WRAPPER_EXTENSION</key>
        <string>app</string>
        <key>WRAPPER_SUFFIX</key>
        <string>.$(WRAPPER_EXTENSION)</string>
    </dict>
    <key>DefaultTargetName</key>
    <string>Application</string>
    <key>Description</key>
    <string>Application</string>
    <key>IconNamePrefix</key>
    <string>TargetApp</string>
    <key>Identifier</key>
    <string>com.apple.product-type.application</string>
    <key>Name</key>
    <string>Application</string>
    <key>PackageTypes</key>
    <array>
        <string>com.apple.package-type.wrapper.application</string>
    </array>
    <key>SupportsZeroLink</key>
    <string>YES</string>
    <key>Type</key>
    <string>ProductType</string>
    <key>Validation</key>
    <dict>
        <key>AdditionalValidationClass</key>
        <string>XCiPhoneOSPlatformPlugin</string>
        <key>Checks</key>
        <dict>
            <key>!(  $(VALIDATE_PRODUCT) == NO &amp;&amp; $(CODE_SIGN_IDENTITY) == 'iPhone distribution'  )</key>
            <string>The Validate Built Product build setting was not enabled when building for distribution.</string>
        </dict>
        <key>ValidationToolSpec</key>
        <string>com.apple.build-tools.platform.validate</string>
    </dict>
</dict>
<dict>
    <key>Class</key>
    <string>PBXBundleProductType</string>
    <key>DefaultBuildProperties</key>
    <dict>
        <key>FULL_PRODUCT_NAME</key>
        <string>$(WRAPPER_NAME)</string>
    </dict>
    <key>Description</key>
    <string>in-app Purchase Content</string>
    <key>HasInfoPlist</key>
    <string>YES</string>
    <key>HasInfoPlistStrings</key>
    <string>NO</string>
    <key>Identifier</key>
    <string>com.apple.product-type.in-app-purchase-content</string>
    <key>IsWrapper</key>
    <string>YES</string>
    <key>Name</key>
    <string>in-app Purchase Content</string>
    <key>PackageTypes</key>
    <array>
        <string>com.apple.package-type.in-app-purchase-content</string>
    </array>
    <key>Type</key>
    <string>ProductType</string>
</dict>
<dict>
    <key>AlwaysPerformSeparateStrip</key>
    <string>YES</string>
    <key>Class</key>
    <string>PBXStaticLibraryProductType</string>
    <key>DefaultBuildProperties</key>
    <dict>
        <key>CODE_SIGNING_ALLOWED</key>
        <string>NO</string>
        <key>EXECUTABLE_EXTENSION</key>
        <string>a</string>
        <key>EXECUTABLE_PREFIX</key>
        <string>lib</string>
        <key>EXECUTABLE_SUFFIX</key>
        <string>.$(EXECUTABLE_EXTENSION)</string>
        <key>FRAMEWORK_FLAG_PREFIX</key>
        <string>-framework</string>
        <key>FULL_PRODUCT_NAME</key>
        <string>$(EXECUTABLE_NAME)</string>
        <key>GCC_ENABLE_SYMBOL_SEParaTION</key>
        <string>NO</string>
        <key>INSTALL_PATH</key>
        <string>/usr/local/lib</string>
        <key>LIBRARY_FLAG_NOSPACE</key>
        <string>YES</string>
        <key>LIBRARY_FLAG_PREFIX</key>
        <string>-l</string>
        <key>MACH_O_TYPE</key>
        <string>staticlib</string>
        <key>PRIVATE_HEADERS_FOLDER_PATH</key>
        <string>/usr/local/include</string>
        <key>PUBLIC_HEADERS_FOLDER_PATH</key>
        <string>/usr/local/include</string>
        <key>REZ_EXECUTABLE</key>
        <string>YES</string>
        <key>SEParaTE_STRIP</key>
        <string>YES</string>
        <key>STRIP_STYLE</key>
        <string>debugging</string>
    </dict>
    <key>DefaultTargetName</key>
    <string>Static Library</string>
    <key>Description</key>
    <string>Static library</string>
    <key>IconNamePrefix</key>
    <string>TargetLibrary</string>
    <key>Identifier</key>
    <string>com.apple.product-type.library.static</string>
    <key>Name</key>
    <string>Static Library</string>
    <key>PackageTypes</key>
    <array>
        <string>com.apple.package-type.static-library</string>
    </array>
    <key>Type</key>
    <string>ProductType</string>
</dict>
</array>
</plist>

重新启动XCode,然后清理您的项目并为您的设备再次构建它.

Xcode 4.5:没有iphoneos的“com.apple.product-type.application”产品类型的更多相关文章

  1. html5 canvas合成海报所遇问题及解决方案总结

    这篇文章主要介绍了html5 canvas合成海报所遇问题及解决方案总结,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧

  2. Html5移动端适配IphoneX等机型的方法

    这篇文章主要介绍了Html5移动端适配IphoneX等机型的方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧

  3. 有关HTML5页面在iPhoneX适配问题

    这篇文章主要介绍了有关HTML5页面在iPhoneX适配问题,需要的朋友可以参考下

  4. HTML5 WebSocket实现点对点聊天的示例代码

    这篇文章主要介绍了HTML5 WebSocket实现点对点聊天的示例代码的相关资料,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧

  5. Html5 页面适配iPhoneX(就是那么简单)

    这篇文章主要介绍了Html5 页面适配iPhoneX(就是那么简单),文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧

  6. H5页面适配iPhoneX(就是那么简单)

    这篇文章主要介绍了H5页面适配iPhoneX(就是那么简单),文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧

  7. ios – Xcode找不到Alamofire,错误:没有这样的模块’Alamofire’

    我正在尝试按照github(https://github.com/Alamofire/Alamofire#cocoapods)指令将Alamofire包含在我的Swift项目中.我创建了一个新项目,导航到项目目录并运行此命令sudogeminstallcocoapods.然后我面临以下错误:搜索后我设法通过运行此命令安装cocoapodssudogeminstall-n/usr/local/bin

  8. ios – 在没有iPhone6s或更新的情况下测试ARKit

    我在决定下载Xcode9之前.我想玩新的框架–ARKit.我知道要用ARKit运行app我需要一个带有A9芯片或更新版本的设备.不幸的是我有一个较旧的.我的问题是已经下载了新Xcode的人.在我的情况下有可能运行ARKit应用程序吗?那个或其他任何模拟器?任何想法或我将不得不购买新设备?解决方法任何iOS11设备都可以使用ARKit,但是具有高质量AR体验的全球跟踪功能需要使用A9或更高版本处理器的设备.使用iOS11测试版更新您的设备是必要的.

  9. ios – 在Swift的UIView中找到UILabel

    我正在尝试在我的UIViewControllers的超级视图中找到我的UILabels.这是我的代码:这是在Objective-C中推荐的方式,但是在Swift中我只得到UIViews和CALayer.我肯定在提供给这个方法的视图中有UILabel.我错过了什么?我的UIViewController中的调用:解决方法使用函数式编程概念可以更轻松地实现这一目标.

  10. ios – containerURLForSecurityApplicationGroupIdentifier:在iPhone和Watch模拟器上给出不同的结果

    我使用默认的XCode模板创建了一个WatchKit应用程序.我向iOSTarget,WatchkitAppTarget和WatchkitAppExtensionTarget添加了应用程序组权利.(这是应用程序组名称:group.com.lombax.fiveminutes)然后,我尝试使用iOSApp和WatchKitExtension访问共享文件夹URL:延期:iOS应用:但是,测试NSURL

随机推荐

  1. iOS实现拖拽View跟随手指浮动效果

    这篇文章主要为大家详细介绍了iOS实现拖拽View跟随手指浮动,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下

  2. iOS – genstrings:无法连接到输出目录en.lproj

    使用我桌面上的项目文件夹,我启动终端输入:cd然后将我的项目文件夹拖到终端,它给了我路径.然后我将这行代码粘贴到终端中找.-name*.m|xargsgenstrings-oen.lproj我在终端中收到此错误消息:genstrings:无法连接到输出目录en.lproj它多次打印这行,然后说我的项目是一个目录的路径?没有.strings文件.对我做错了什么的想法?

  3. iOS 7 UIButtonBarItem图像没有色调

    如何确保按钮图标采用全局色调?解决方法只是想将其转换为根注释,以便为“回答”复选标记提供更好的上下文,并提供更好的格式.我能想出这个!

  4. ios – 在自定义相机层的AVFoundation中自动对焦和自动曝光

    为AVFoundation定制图层相机创建精确的自动对焦和曝光的最佳方法是什么?

  5. ios – Xcode找不到Alamofire,错误:没有这样的模块’Alamofire’

    我正在尝试按照github(https://github.com/Alamofire/Alamofire#cocoapods)指令将Alamofire包含在我的Swift项目中.我创建了一个新项目,导航到项目目录并运行此命令sudogeminstallcocoapods.然后我面临以下错误:搜索后我设法通过运行此命令安装cocoapodssudogeminstall-n/usr/local/bin

  6. ios – 在没有iPhone6s或更新的情况下测试ARKit

    我在决定下载Xcode9之前.我想玩新的框架–ARKit.我知道要用ARKit运行app我需要一个带有A9芯片或更新版本的设备.不幸的是我有一个较旧的.我的问题是已经下载了新Xcode的人.在我的情况下有可能运行ARKit应用程序吗?那个或其他任何模拟器?任何想法或我将不得不购买新设备?解决方法任何iOS11设备都可以使用ARKit,但是具有高质量AR体验的全球跟踪功能需要使用A9或更高版本处理器的设备.使用iOS11测试版更新您的设备是必要的.

  7. 将iOS应用移植到Android

    我们制作了一个具有2000个目标c类的退出大型iOS应用程序.我想知道有一个最佳实践指南将其移植到Android?此外,由于我们的应用程序大量使用UINavigation和UIView控制器,我想知道在Android上有类似的模型和实现.谢谢到目前为止,guenter解决方法老实说,我认为你正在计划的只是制作难以维护的糟糕代码.我意识到这听起来像很多工作,但从长远来看它会更容易,我只是将应用程序的概念“移植”到android并从头开始编写.

  8. ios – 在Swift中覆盖Objective C类方法

    我是Swift的初学者,我正在尝试在Swift项目中使用JSONModel.我想从JSONModel覆盖方法keyMapper,但我没有找到如何覆盖模型类中的Objective-C类方法.该方法的签名是:我怎样才能做到这一点?解决方法您可以像覆盖实例方法一样执行此操作,但使用class关键字除外:

  9. ios – 在WKWebView中获取链接URL

    我想在WKWebView中获取tapped链接的url.链接采用自定义格式,可触发应用中的某些操作.例如HTTP://我的网站/帮助#深层链接对讲.我这样使用KVO:这在第一次点击链接时效果很好.但是,如果我连续两次点击相同的链接,它将不报告链接点击.是否有解决方法来解决这个问题,以便我可以检测每个点击并获取链接?任何关于这个的指针都会很棒!解决方法像这样更改addobserver在observeValue函数中,您可以获得两个值

  10. ios – 在Swift的UIView中找到UILabel

    我正在尝试在我的UIViewControllers的超级视图中找到我的UILabels.这是我的代码:这是在Objective-C中推荐的方式,但是在Swift中我只得到UIViews和CALayer.我肯定在提供给这个方法的视图中有UILabel.我错过了什么?我的UIViewController中的调用:解决方法使用函数式编程概念可以更轻松地实现这一目标.

返回
顶部