1: Use Uiimageview as the background, but directly put the button or Uitextfield on it can not be the corresponding event.
Workaround: Uiimageview default userinteractionenabled is no, modify it to Yes, or you can directly have a property on the view above Xcode tick the user Interaction enabled scene ( Put a picture view in the scrolling view, put a button on the picture view, and find that there is no response effect.
2:afnetworking newspaper "Request failed:unacceptable content-type:text/html"
= [nssetsetwithobjects:@ "application/json"@ "text/html", @" Text/json "@"text/javascript", nil]; plus @"text/html Part, in fact, is to add a data format returned by the server.
Conversion of 3:nsmutablearray and Nsarray to each other
// Nsarray-Nsmutablearray Nsmutablearray *mymutablearray = [MyArray mutablecopy]; // Nsmutablearray-Nsarray Nsarray *myarray = [Mymutablearray copy];
4: Customize the Back button above the system navigation bar, as well as the text, right favorite button
//Middle TitleUILabel *navlabel = [[UILabel alloc] Initwithframe:cgrectmake (0,0, the, -)]; Navlabel.text=@"Group Purchase Details"; Navlabel.textcolor=[Uicolor Whitecolor]; Navlabel.font= [Uifont systemfontofsize: -]; Navlabel.textalignment=Nstextalignmentcenter; Self.navigationItem.titleView=Navlabel; //Right Collection buttonUIButton *rightbutton =[UIButton Buttonwithtype:uibuttontypecustom]; Rightbutton.frame= CGRectMake (0,0, -, -); [Rightbutton Setbackgroundimage:load_image (@"Meishoucang") Forstate:uicontrolstatenormal]; [Rightbutton addtarget:self Action: @selector (Doshoucang) forcontrolevents:uicontroleventtouchupinside]; Uibarbuttonitem*rightitem =[[Uibarbuttonitem alloc] Initwithcustomview:rightbutton]; Self.navigationItem.rightBarButtonItem=Rightitem; //left Back buttonUIButton *fanhuibutton =[UIButton Buttonwithtype:uibuttontypecustom]; Fanhuibutton.frame= CGRectMake (0,0, -, +); [Fanhuibutton Setbackgroundimage:load_image (@"Fanhuijiantou") Forstate:uicontrolstatenormal]; [Fanhuibutton addtarget:self Action: @selector (Dofanhui) forcontrolevents:uicontroleventtouchupinside]; Uibarbuttonitem*leftitem =[[Uibarbuttonitem alloc] Initwithcustomview:fanhuibutton]; Self.navigationItem.leftBarButtonItem=Leftitem The title font on the navigation bar, the font size can be defined so that full use of the system's [Self.navigationController.navigationBar settitletextattributes:[ Nsdictionary Dictionarywithobjectsandkeys: [Uicolor colorwithred:1.0/255Green1.0/255Blue1.0/255Alpha1], Uitextattributetextcolor,[uicolor clearcolor],uitextattributetextshadowcolor,[uifont systemFontOfSize: -],uitextattributefont,nil]];
5: Clean the bottom empty column of UITableView
Self.tableView.tableFooterView = [[UIView alloc] init];
6: How to hide the right mouse button after navigation jump
// hide the left side of the head return self.navigationitem.hidesbackbutton=YES; // Hide head right self.navigationitem.rightbarbuttonitem.customview.hidden=yes;
7: If you want to set the background map for the Uicollectionviewcontroller view
UIImage *image=[uiimage imagenamed:@ "appbg"];self.collectionview.layer.contents = (ID) image. Cgimage;
8: Can be modified in other places Rootviewcontroller
UIWindow *window = [uiapplication sharedapplication].keywindow; = [[Hvwtabbarviewcontroller alloc] init];
9: Sina Weibo authorized login warning:attempt to present on whose view isn't in the window hierarchy!
Introductoryviewcontroller *introductory=[mainstoryboard Instantiateviewcontrollerwithidentifier:@"Introductoryview"]; Uinavigationcontroller*rootnavigationcontroller=[[Uinavigationcontroller alloc] initwithrootviewcontroller:introductory]; Self.window.rootViewController=Rootnavigationcontroller; The main problem is a jump to B, then B put a button to authorize Sina Weibo, add a uinavigationcontroller, and then use NAV to jump when a jumps to B: Uistoryboard*mainstoryboard=[uistoryboard Storyboardwithname:@"Main"Bundle:nil]; Loginviewcontroller* Loginviewcontroll=[mainstoryboard Instantiateviewcontrollerwithidentifier:@"Loginviewcontroller"]; [Self.navigationcontroller Pushviewcontroller:loginviewcontroll Animated:yes];
10: In the introduction of the third party TCWEIBOSDK newspaper linker command failed with exit Code1 (Use-v to see invocation)
Because of the repeated introduction of the Libtcweibosdk class library, Targets-project-build Phases-link Binary with libraries, there are three libtcweibosdk, can delete libtcweibosdk-i386.a
11:nsuserdefaults Store min nsdictionary
Note: The data types supported by Nsuserdefaults are NSString, NSNumber, NSDate, Nsarray, Nsdictionary, BOOL, Nsinteger, Nsfloat, and other system-defined data types. The problem encountered this time: when the value inside the nsdictionary is null, the Nsuserdefaults is reported as an exception (attempt to insert non-property ListObject); Workaround: Filter the values in the dictionary and convert them to null values of the string; The code is as follows (create an extension Class): @implementation nsdictionary (Common)-(Nsdictionary *) changedictionarynotnill{nsmutabledictionary*muresult=[[Nsmutabledictionary alloc]init]; Nsenumerator*enumerator=[self keyenumerator]; ID key; while((key=[Enumerator nextobject])) {ID value=[self objectforkey:key]; if((NSNull *) value==[nsnullNULL]) {[Muresult setobject:@""Forkey:key]; } Else{[Muresult setobject:value forkey:key]; } } returnMuresult;} @end
iOS Development Basics-Fragmentation 8