Home Backend Development PHP Tutorial iOS development questions (5)

iOS development questions (5)

Jan 20, 2017 am 09:34 AM

42. Warning: Multiplebuild commands for output file
The target references a resource with a duplicate name
Find the current target, expand it, find the CopyBundle Resources column, and then find the resource with the duplicate name in it and delete the unnecessary ones That's it
43. Signature error: Provisioningprofile can't be found
In Xcode, when you update your certificate and then recompile your program, Code Sign error: Provisioning will always appear during real-machine debugging. profile 'XXXX' can't be found will annoy you. Let’s talk about the solution below so that you can solve this problem well.
1. Close your project, find the project file XXXX.xcodeproj, right-click on the file and select "ShowPackage Contents". A new Finder will open. Note: In fact, XXXX.xcodeproj is a folder. The three files in the newly opened Finder here are the files in the XXXX.xcodeproj folder.
2. Find project.pbxproj in the newly opened Finder and open it. Find the encoding information for your previous certificate here. The error message I reported before was:
CodeSign error: Provisioning profile '37D44E7F-0339-4277-9A82-C146A944CD46', so I used the search method to find all the lines including 37D44E7F-0339-4277-9A82-C146A944CD46. and delete.
3. Save, restart your project, and compile again. That's OK.
44. Arc4random_uniform is unavailable after upgrading to Xcode 4.6
When the project is upgraded to Xcode4.6, a compilation error occurs:

Useof undeclared identifier 'arc4random_uniform'; did you mean 'arc4random_stir'?
Copy after login

It seems that SDK 6.1 does not support 'arc4random_uniform', change The problem is solved after changing to 'arc4random'.
45. After upgrading Xcode4.6, a compilation error occurred: Undefinedsymbols for architecture x86_64: "_OBJC_CLASS_$_NSMutableOrderedSet"
In the build settings, set "Implicitly link Objective-C Runtime Support" to NO, and the problem is solved.
46. After upgrading Xcode4.6, a warning appeared: function'sleep' is invalid in C99
#import and then solved. After upgrading to Xcode4.6, many header files are not automatically imported by default, such as stdlib.h and unistd.h.
47. Compilation error: autolayout on ios versions prior to 6.0
This problem occurs when compiling Target 4.0 app in Xcode 4.6 (real machine debugging, device is 3GS, upgraded to iOS 6.1.3). Find the .xib file that reported the error, and disable "UseAutolayout" (see the figure below) in the Document panel.

48. How to set the text alignment of the button TitleLabel?
Set the contentHorizontalAlignment property:
emailBtn.contentHorizontalAlignment= UIControlContentHorizontalAlignmentLeft;
Or use contentEdgeInset to adjust the text margins (0 means not aligned):
emailBtn.contentEdgeInsets= UIEdgeInsetsMake(0, 10, 0, 0) ;
Or use both together.
49. Error: errorDomain=UA_ASIHTTPRequestErrorDomain Code=8 "Failed to move file from
Theerror happens after the file is downloaded; but before the file is successfully moved from the tmp location to the Cache location
The error happens after The file is downloaded to a temporary file, but before it is moved to the documents directory (you can use iExplorer to check the existence of the temporary file).
Use "[requestsetShouldAttemptPersistentConnection:NO];" to solve this problem. 50. Compilation error: "has been modified since the precompiled header was built"

The file was modified when precompiling the header.
51. Error Could not change excutable permissions on the application
Cannot be used. Installing two different applications with the same AppID on the iPhone usually causes problems when executing the Project-->Profile command in Xcode. This is because a debug application is usually installed on the iPhone during real-device debugging and the Project-- is executed. >Profile and then install the program again on the iPhone. The AppIDs of the two programs are naturally the same, so the above error occurs. Solution: First delete the program on the iPhone, and then execute the Project-->Profile command.

52. Instruments error: Targetfaild to run, as shown in the figure below.

iOS development questions (5)##



点击菜单栏Scheme 的左下角,选择“Edit Scheme...”,在弹出窗口左侧边栏选中“Profile xxx.app”,将其“BuildConfiguration”从“Release”修改为 “Debug”。
53、查看指针所指向的对象
如果知道地址,可以用GDB命令打印该地址所代表的对象,例如:
po 0x1fba2e20
如果该指针不是一个对象,用:
p0x1fba2e20
54、Xcode 打包时 skip install的问题
总结:在自身工程里面需要将skipinstall 设置为NO, 在引入其他静态库文件的工程中skip install 设置为YES,否则在 Orgnizer 中无法发布你的程序。
-主App是需要部署的,所以不要将Skip Install设为YES, 只需要改依赖项目。
55、错误: Pushinga navigation controller is not supported
SDK不允许直接在一个 NavigationController 中 push 一个 NavigationController。你可以用这句代码代替:
[self.navigationControllerpushViewController:nc.topViewController animated:YES];
56、为什么当用户点击Tab bar 上的按钮,总是会显示所选 NavigationController 的 rootViewController?
你可以为TabBarController 指定一个delegate 属性,并在 delegate 对象中实现 UITabBarControllerDelegate 委托:

#pragma mark TabBarController Delegate
- (BOOL)tabBarController:(UITabBarController *)tabBarControllershouldSelectViewController:(UIViewController *)viewController {
UIViewController *tbSelectedController= tabBarController.selectedViewController;
if ([tbSelectedController isEqual:viewController]) {
return NO;
}
return YES;
}
Copy after login

57、使用setTitle 不能刷新 NavigationBar 的标题文本
有时候使用ViewController的 setTitle 方法并不能刷新 NavigationBar 的 title文本。极大的可能是你使用类似的代码定制了 titleView:

UILabel* label = [[[UILabel alloc] init] autorelease];
label.backgroundColor=[UIColor clearColor];
label.text = self.title;
label.font = [UIFont systemFontOfSize: 20];
……
[self.navigationItem setTitleView: label];
Copy after login

如果这样,你需要用同样的代码重新定制titleView,才能刷新 NavigationBar title。或者,使用默认的 TitleView 而不要去定制它。
58、 nested push animation can result in corrupted navigation bar……
如果你在代码中连续多次(两次以上)pushViewController,会出现以上信息,这既不是错误也不少警告,只是控制台输出的信息,但它会导致一些潜在的问题,比如NavigationController 的栈错误(比如用户有时候必须连按两次 backButton 才能返回上级视图)。往往还会伴随有如下信息的输出:
Unbalancedcalls to begin/end appearance transitions
所谓连续多次,是指至少有一次push 是不经过用户交互而直接代码调用的。例如,当用户点击一个 TableViewCell,弹出一个 ViewController,然后在这个ViewController 的 viewDidLoad 方法或 viewWillAppear 方法中用代码 Push 另一个 ViewController。这第二次push 并不是由用户动作而是由代码触发的,因此会导致上述问题。
解决办法是,在第二次push 时,将 animated 参数设置为 NO。
59、真机可以执行,模拟器不行
有时候出现模拟器不能调试的情况,程序一运行就退出,而且模拟器似乎“卡死”掉了,只出现一个黑黑的窗口,按Home键也没有作用。但是在真机上程序却可以运行。这个问题的原因未知,但有一个解决方式是:在另一个工程中打开模拟器,然后在模拟器中把有问题的程序删除即可。
60、警告“numeration not handledin switch”
新的Apple LLVM compiler 4.0中,会对 switch 变量进行检查,如果该变量为枚举类型,则需要处理所有的枚举值,你可以添加一个 default:break;语句表示所有未列举的枚举值已处理。或者将编译选项"Check switch statements"设置为NO。也可以用下列宏忽略switch 检查:

#pragmaclang diagnostic push
#pragmaclang diagnostic ignored "-Wswitch"...<switchstatment>...
#pragmaclang diagnostic pop
Copy after login


以上就是iOS 开发百问(5)的内容,更多相关内容请关注PHP中文网(www.php.cn)!


Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1666
14
PHP Tutorial
1273
29
C# Tutorial
1252
24
The first version of Apple's iOS 18 was exposed to have so many bugs: serious fever, WeChat delay The first version of Apple's iOS 18 was exposed to have so many bugs: serious fever, WeChat delay Jun 13, 2024 pm 09:39 PM

The annual WWDC has ended, and iOS18 is undoubtedly the focus of everyone's attention. Currently, many iPhone users are rushing to upgrade to iOS18, but various system bugs are making people uncomfortable. Some bloggers said that you should be cautious when upgrading to iOS18 because "there are so many bugs." The blogger said that if your iPhone is your main machine, it is recommended not to upgrade to iOS18 because the first version has many bugs. He also summarized several system bugs currently encountered: 1. Switching icon style is stuck, causing the icon not to be displayed. 2. Flashlight width animation is often lost. 3. Douyin App cannot upload videos. 4. WeChat message push is delayed by about 10 seconds. 5 . Occasionally, the phone cannot be made and the screen is black. 6. Severe fever.

Apple re-releases iOS/iPadOS 18 Beta 4 update, version number raised to 22A5316k Apple re-releases iOS/iPadOS 18 Beta 4 update, version number raised to 22A5316k Jul 27, 2024 am 11:06 AM

Thanks to netizens Ji Yinkesi, xxx_x, fried tomatoes, Terrence, and spicy chicken drumsticks for submitting clues! According to news on July 27, Apple today re-released the iOS/iPadOS 18 Beta 4 update for developers. The internal version number was upgraded from 22A5316j to 22A5316k. It is currently unclear the difference between the two Beta 4 version updates. Registered developers can open the "Settings" app, enter the "Software Update" section, click the "Beta Update" option, and then toggle the iOS18/iPadOS18 Developer Beta settings to select the beta version. Downloading and installing the beta version requires an Apple ID associated with a developer account. Reported on July 24, iO

Update | Hacker explains how to install Epic Games Store and Fortnite on iPad outside the EU Update | Hacker explains how to install Epic Games Store and Fortnite on iPad outside the EU Aug 18, 2024 am 06:34 AM

Update: Saunders Tech has uploaded a tutorial to his YouTube channel (video embedded below) explaining how to install Fortnite and the Epic Games Store on an iPad outside the EU. However, not only does the process require specific beta versions of iO

Apple releases open source Swift package for homomorphic encryption, deployed in iOS 18 Apple releases open source Swift package for homomorphic encryption, deployed in iOS 18 Jul 31, 2024 pm 01:10 PM

According to news on July 31, Apple issued a press release yesterday (July 30), announcing the launch of a new open source Swift package (swift-homomorphic-encryption) for enabling homomorphic encryption in the Swift programming language. Note: Homomorphic Encryption (HE) refers to an encryption algorithm that satisfies the homomorphic operation properties of ciphertext. That is, after the data is homomorphically encrypted, specific calculations are performed on the ciphertext, and the obtained ciphertext calculation results are processed at the same time. The plaintext after state decryption is equivalent to directly performing the same calculation on the plaintext data, achieving the "invisibility" of the data. Homomorphic encryption technology can calculate encrypted data without leaking the underlying unencrypted data to the operation process.

New features of Apple's iOS 18 'Boundless Notes” app: expanded Scenes functionality, introduced grid alignment New features of Apple's iOS 18 'Boundless Notes” app: expanded Scenes functionality, introduced grid alignment Jun 02, 2024 pm 05:05 PM

According to news on June 1, technology media AppleInsider published a blog post today, stating that Apple will launch a new navigation function of "Scenes" for the "Freeform" application extension in the iOS18 system, and add new options for object alignment. Introduction to the "Wubianji" application First, let's briefly introduce the "Wubianji" application. The application will be launched in 2022 and has currently launched iOS, iPadOS, macOS15 and visionOS versions. Apple’s official introduction is as follows: “Boundless Notes” is an excellent tool for turning inspiration into reality. Sketch projects, design mood boards, or start brainstorming on a flexible canvas that supports nearly any file type. With iCloud, all your boards

Apple iOS/iPadOS 18 Developer Preview Beta 4 released: Added CarPlay wallpapers, sorted out settings options, enhanced camera control Apple iOS/iPadOS 18 Developer Preview Beta 4 released: Added CarPlay wallpapers, sorted out settings options, enhanced camera control Jul 24, 2024 am 09:54 AM

Thanks to netizens Spicy Chicken Leg Burger, Soft Media New Friends 2092483, Handwritten Past, DingHao, Xiaoxing_14, Wowotou Eat Big Kou, Feiying Q, Soft Media New Friends 2168428, Slades, Aaron212, Happy Little Hedgehog, Little Earl, Clues for the little milk cat that eats fish! [Click here to go directly to the upgrade tutorial] According to news on July 24, Apple today pushed the iOS/iPadOS18 developer preview version Beta4 update (internal version number: 22A5316j) to iPhone and iPad users. This update is 15 days after the last release. . Carplay Wallpaper Apple has added wallpapers to CarPlay, covering light and dark modes. Its wallpaper style is similar to iPhone

Apple iOS 17.5 RC version released: allows EU iPhone users to download apps from the website Apple iOS 17.5 RC version released: allows EU iPhone users to download apps from the website May 08, 2024 am 09:30 AM

[Click here to go directly to the upgrade tutorial] According to news on May 8, Apple pushed the iOS17.5RC update (internal version number: 21F79) to iPhone users today. This update is 70 days away from the last release. How to upgrade iOS/iPadOS/watchOS/macOS development version and public beta version? To upgrade the iOS/iPadOS17 developer preview version and public beta version, you can refer to the experience shared by friends: Experience Post 1||Experience Post 2||Experience Post 3||Experience Post 4. Starting from the iOS/iPadOS 16.4 Developer Preview Beta 1, you need to register for the Apple Developer Program. After registration, open the system [Settings] [Software Update] to see the upgrade option. Please note that your iPhone or IP

Haqu K2 projector brings Olympic passion and dreams within reach Haqu K2 projector brings Olympic passion and dreams within reach Jul 24, 2024 pm 01:34 PM

In the just-concluded European Cup final, did you cheer crazily for the team you supported? In the upcoming Paris Olympics, are you also looking forward to perfectly capturing the highlight moments of each event? Among them, having a high-quality viewing equipment is crucial. The Haqu K2 projector is well-deserved to be a good choice for watching games due to its high cost performance and excellent performance. It not only has high brightness and clear picture quality, but also provides an immersive viewing experience, making every exciting moment of the game feel as if it is close at hand. Are you already attracted by such a device? It will definitely allow you to enjoy the passion and dreams of the Olympic Games at home. The most intimate highlight of Haqu K2 is its 210° super angle adjustment, which makes it convenient to watch movies whether on the ceiling or on the wall.

See all articles