iOS面试题

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

12243UNIX84C95Objective-C156357KVO-KVC458Block479Swift5910UI621185129013951410115Runloop1101611717WebViewJS1281813719147201482115822Runtime1592317824184———1861!!!iOS190892815iOS每下每github每以每232SVNGit每SVN•SVN1Repository  2Server      3Client      4&  1checkout    2update      3commit      •SVN()•SVN$cdcheckout$svnco=manager--password=managercheckout(co)$svnstisnotaworkingcopysvnsvnsvn$svnlog$svnlogfilename$svnlogfilename@1$touchmain.c$openmain.c4$svnst$svnaddmain.c/main.*$svnci-m$svnrmPerson.h$svnci-m$svnrevertPerson.m$svnupdate-r5(p)postpone           (mc)mine-conflict     (tc)theirs-conflict   svnst'''A''C''D''I''M''R''X''?''!'svn'~'5Git•git$githelpgit$githelpqCTRL+B/$gitinit$gitconfiguser.namemanager$gitconfiguser.emailmanager@gmail.com$gitconfig--globaluser.namemanager$gitconfig--globaluser.emailmanager@gmail.com.gitconfig$gitconfig-l$touchmain.c$openmain.c$gitstatus$gitaddmain.c$gitcommit-mmain.c-mvimvim$gitadd.$touchPerson.hPerson.m6$gitadd.$gitcommit-mPerson$openPerson.h$gitadd.$gitcommit-mPersongitsvn$gitlog$gitlog$gitreset--hardHEAD$gitreset--hardHEAD^3$gitreset--hardHEAD~3$gitreset--harde695b67$gitreflog••••SourceTree⼒GIT被CornerStone⼒SVN被经•svngit每•⼒SVN被每每每•Git每73UNIX每每1.cd
2.pwd
UNIX
3.ls
$ls
$ls-a
$ls-l
$ls-la
4.touchUNIX
$touchtest.txttouchtest.txt信test.txt1.cat
2.more
1
2TAB84CC⼦iOSCCiOS每C每•least=MIN(*p++,b);•((p++)=(b)?(p++):(*p++))p++#define1defineSECONDS_PER_YEAR(606024*365)UL(UL)MINdefineMIN(A,B)A=(B)?(A):(B))Maxintarray[5]={1,2,3,4,5};int*p=&array[0];intmax=Max(*p++,1);printf(%d%d,max,*p);12#defineMax(X,Y)((X)(Y)?(X):(Y))++–parray1.*p++*p,p++,Max(*p++,1)(*p++)(1)?(*p++):(1)=(1)(1)?(*p++):(1)=*p++p211max1(*p++)p23.*p++*(++p)9(*++p)(1)?(*++p):(1)=(2)(1)?(*++p):(1)=max=*++p;=*p=3max=3;defineconstλ   #define#define#defineλ   const#define“”#defineN2+3//N5Ninta=N/2; //a2.5a3.5volatile?•volatile••(Non-automaticvariables)•sprintfstrcpymemcpy?-strcpy-sprintf%s-memcpymemcpymemcpymemcpy10--strcpy-snprintf-memcpy+1strcpymemcpymemcpystrcpy-strcpysnprintfmemcpymemcpymemcpymemcpysprintf,strcpy,memcpy•strcpystrcpy(chardst,constcharsrc);
•srcdst'\0'
•memcpymemcpy(chardst,constcharsrc,unsignedintlen);lensrcdst(len)
•sprintfsprintf
static•static•staticstatic•0.0x00static0.11static•staticstatic;果果•staticstatic经果果•static做做static做做回const•constinta;intconsta;a•constinta;intconsta;a()•int*consta;a()•intconst*consta;a()•友经⽣(memoryleak)每•◦友Windows,友还每友友Windows友2M⼒1M被友overflow每友每◦还每每没每每•
new/delete每友友友•
每友2每每alloc做友每12•
友友友友友友每C/C++做•友经
sizeof经4•每全全经全全•回经三•每•每•⼒*被•每•const••sizeof⼒被sizeof每•(++)++++++•每a•⼒Aninteger被•⼒Apointertoaninteger被•⼒Apointertoapointertoanintege被r•10⼒Anarrayof10integers被•10每⼒Anarrayof10pointerstointegers被•10⼒Apointertoanarrayof10integers被•做做⼒Apointertoafunctionthattakesanintegerasanargument
andreturnsaninteger被13•10做做⼒Anarrayoftenpointerstofunctionst
hattakeanintegerargumentandreturnaninteger被
••inta;//Aninteger•int*a;//Apointertoaninteger•int**a;//Apointertoapointertoaninteger•inta[10];//Anarrayof10integers•int*a[10];//Anarrayof10pointerstointegers•int(*a)[10];//Apointertoanarrayof10integers•int(*a)(int);//Apointertoafunctionathattakesanintegerargumentandreturnsaninteger•int(*a[10])(int);//Anarrayof10pointerstofunctionsthattakeanintegerargumentandreturnanintegerinta[5]={1,2,3,4,5};int*ptr=(int*)(&a+1);printf(%d,%d,*(a+1),*(ptr+1));2,Ca5a[5]12345a+11a[1]2.&a+1a5*sizeof(int)&a+1a+5a+1sizeof(int)ptrint*ptra+5ptr+1a+6*(ptr+1)*(ptr–1)a+45•做•信信•malloc做new•友做做信做NSLogfloatmoney=1.011;NSLog(@%.1f,money);145Objective-C每OC每(Differencebetweenmethodandselector?)•selectormethod.CoreFoundation•Create信Copy信Retain做release•CFRunLoopObserverCreaterelease做CFRelease();mallocNew•newc++mallocc做•new做delete做mallocfree做•⽣mallocnewnewmalloc每•newmalloc•newmalloc做每•new每
OC•class•
ClassclassNSClassFromString@(@student);
Student*stu=[[classalloc]init];•
Classclass=[Studentclass];
NSString*className=NSStringFromClass(class);•SEL•
SELselector=NSSelectorFromClass(@setName);
[stuperformSelector:selectorwithObject:@Mike];15!!!iOS190892815iOS•
NSStringFomrSelector(@selector*(setName:))SEL?SEL?,SEL?•SEL每SEL每SELSEL每•SELs1=@selector(test1);//test1SEL果•SELs2=NSSelectorFromString(@test1);//SEL••1.[persontext]•2.SELSELaaa=@selector(text);[personperformSelector:aaa];
NSObject?,???•NSObject••每gettersetter•idxxxNS/CF/CG/CA/UI•做cocoaFundation⽆•做coreFundation⽆•做CoreGraphics.frameworks⽆•做CoreAnimation.frameworks⽆•做UIkit⽆•每⼒信被经⼒被每每•⼈每经16每每•最每每每⼒overload被⼒⼈被⼒override被⼒⼈被每1.⼒被经2.⼒被每•每每
Objective-C?(Whenwecallobjectivecisruntimelanguagewhatdoesitmean?)•,每,每•,,每•:每•(life)-eat;,,life,eat,eat每(eat)每,⼦.
readwrite,readonly,assign,retain,copy,nonatomic?•readwrite;gettersetter;•readonlygettersetter,;•assign三,setter三;;assign,NSInteger,double,bool;•retain,setter,三,retaincount+1;•copy三,setter;;•nonatomic,settergetter;•atomic,nonatomic每17NotificationCenterKVCKVODelegate??()•KVO⼒Key-Value-Observing被,,每•KVC(Key-Value-Coding),setValue◦keysets

1 / 191
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功