iOS work notes (12)

Source: Internet
Author: User

1. Jumping from Controllera to photographic uiimagepickercontroller can only be used in presentviewcontroller form, because when defining Uiimagepickercontroller,

Uiimagepickercontroller *pickercontroller == no;pickercontroller. delegate == Uiimagepickercontrollersourcetypecamera;

When setting delegate, if only uiimagepickercontrollerdelegate is introduced, the following warning is reported:

assigning to 'ID<UINavigationControllerDelegate,UIImagePickerControllerDelegate> ' from incompatible Type ' Addsightingviewcontroller *const __strong '

The workaround is to add uinavigationcontrollerdelegate again. As follows

@interface Controllera () <UIImagePickerControllerDelegate,UINavigationControllerDelegate>@end

So when the jump interface is used

[Self.navigationcontroller Pushviewcontroller:pickercontroller Animated:yes];

will report pushing a navigation controller is not supported error
Warning

2. Fix a valid provisioning profile for this executable is not found issue

When you import a signature and a certificate, this problem still occurs with true machine debugging, so you can follow these steps to troubleshoot
① first Check if provisioning profile is successfully imported
I use the Xcode version of 7.3.1, window-->devices--> check the running real machine-->provisioning profiles view
② Check if the Code Signing Identity in Project and Target is set, it must be the same

3. When depositing basic data types into Nsarray, you can use NSNumber, or you can use shorthand

// nsnumber form _signtypesarr = [Nsarray arraywithobjects:[nsnumber numberwithinteger:3],[nsnumber Numberwithinteger:2], nil];
// abbreviated form _signtypesarr = [Nsarray arraywithobjects:@ (2), @ (2), @ (2), @ (1 ), @ (3), @ (3), @ (3), nil];

But when reading from the array, the following is not an error, but the value is not correct, will take the unexpected value

Nsinteger typeDef = Self.signtypesarr[i];

The right thing is

Nsinteger typeDef = [self.signtypesarr[i] integervalue];

4.NSError conversion to NSString

Nserror *error= [nserror errorwithdomain:@ "" Code:0*errorstr = [Error localizeddescription ];

iOS work notes (12)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.