Программирование на Objective-C - ответы
Количество вопросов - 115
void myFunction(int x);int a = 4;int main (int argc, const char * argv[]){ @autoreleasepool { int a = 6; myFunction(a); NSLog(@"%i", a); } return 0;}void myFunction(int x) { int a = 2; a++;}int a = 3; switch (a) { case 1: //block 1 break; case 2: //block 2 break; default: //default break; }-(void) encodeWithCoder: ( ? ) coder {[ coder encodeObject:name forKey:@"name"];...if ( [ fm fileExistsAtPath:startPath ]) { NSDictionary * fAtt = [ fm attributesOfItemAtPath:startPath error:nil ]; for (NSString *key in fAtt) { NSLog(@"Attribute %@ is %@", key, [ fAtt objectForKey:key]); }}#define I 7int main (int argc, const char * argv[]){ @autoreleasepool { I = I + 3; } return 0;}NSMutableDictionary *dict = [ NSMutableDictionary dictionaryWithObjectsAndKeys:@"a", @"b",@"c", @"d",nil];NSLog(@"%@", [ dict objectForKey:@"d" ]);
-( ? ) count;-( ? ) setCount:(double) c;
NSMutableDictionary *dict = [ NSMutableDictionary dictionaryWithObjectsAndKeys:@"a", @"b",@"c", @"d",nil];NSLog(@"%@", [ dict objectForKey:@"b" ]);
if ( [ fm fileExistsAtPath:startPath ]) { NSDictionary * fAtt = [ fm attributesOfItemAtPath:startPath error:nil ]; [ fm moveItemAtPath:startPath toPath:finalPath error:nil ];}NSMutableString * content = [ NSMutableString stringWithContentsOfURL:path encoding:NSUTF8StringEncoding error:nil ]; [ content appendFormat:littleString ];
-(void) encodeWithCoder: (NSCoder *) coder {[ ? encodeObject:name forKey:@"name"];...#define I 5int main (int argc, const char * argv[]){ @autoreleasepool { I = I + 3; } return 0;}-( ? ) count;-( ? ) setCount:(int) c;
int a = 1; switch (a) { case 1: //block 1 case 2: //block 2 default: //default break; }#define I 8int main (int argc, const char * argv[]) { @autoreleasepool { I = I + 10; } return 0;}int a = 1; switch (a) { case 1: //block 1 break; case 2: //block 2 default: //default break; }-( ? ) count;-( ? ) setCount:(float) c;
NSMutableDictionary *dict = [ NSMutableDictionary dictionaryWithObjectsAndKeys:@"a", @"b",@"c", @"d",nil];NSLog(@"%@", [ dict objectForKey:@"b" ]);
NSMutableString * content = [ NSMutableString stringWithContentsOfURL:path encoding:NSUTF8StringEncoding error:nil ]; NSLog(@"The text is %@", content);[ content appendFormat:littleString ]; [ content writeToURL:path2 atomically:YES ];
if ( [ fm fileExistsAtPath:startPath ]) { NSDictionary * fAtt = [ fm attributesOfItemAtPath:startPath error:nil ]; for (NSString *key in fAtt) { NSLog(@"Attribute %@ is %@", key, [ fAtt objectForKey:key]); } [ fm moveItemAtPath:startPath toPath:finalPath error:nil ];}-(void) ? (NSCoder *) coder {[ coder encodeObject:name forKey:@"name"];...void myFunction(int x);int a = 6;int main (int argc, const char * argv[]){ @autoreleasepool { a--; myFunction(7); NSLog(@"%i", a); } return 0;}void myFunction(int x) { a += x;}NSMutableString * content = [ NSMutableString stringWithContentsOfURL:path encoding:NSUTF8StringEncoding error:nil ]; NSLog(@"The text is %@", content); [ content writeToURL:path2 atomically:YES ];
int myFunction(int x);int a = 6;int main (int argc, const char * argv[]){ @autoreleasepool { NSLog(@"%i", myFunction(4)); } return 0;}int myFunction(int x) { int a = 3; return a+x;}