Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

iphone - a simple person class in objective c -


i'm starting learn objective c, made simple person class, 6 errors, expected specifier-qualifier-list before '-' token

just wondering if can explain me i'm doing wrong,

thanks

#import <foundation/foundation.h> #import <foundation/nsobject.h> #import <foundation/nsstring.h>   @interface person:nsobject {     nsstring *firstname;     nsstring *lastname;       -(void) setfname:(nsstring *) thefirstname;     -(void) setlname:(nsstring *) thelastname;     -(void) printname; } @end  @implementation person {      -(void) setfname:(nsstring *) thefirstname     {         firstname = [[nsstring alloc]initwithstring: thefirstname];     }      -(void) setlname:(nsstring *) thelastname     {         lastname = [[nsstring alloc]initwithstring: thelastname];     }      -(void) printname     {         nslog(@"the person's full name is",firstname,lastname);     }  }  @end   int main (int argc, const char * argv[]) {     nsautoreleasepool * pool = [[nsautoreleasepool alloc] init];      person *person = [[person alloc] init];      [person setfname:@"amir"];     [person setlname:@"karimian"];     [person printname];      [person release];     [pool drain];     return 0; } 

method declaration outside of closing brace.

@interface person:nsobject {     nsstring *firstname;     nsstring *lastname; }  -(void) setfname:(nsstring *) thefirstname; -(void) setlname:(nsstring *) thelastname; -(nsstring *) firstname; -(nsstring *) lastname; -(void) printname;  @end 

and in implementation no brace required.

@implementation person // { not required -(void) setfname:(nsstring *) thefirstname {     // code }  -(void) setlname:(nsstring *) thelastname {  }  // in way  // } not required @end 

there @ least 2 logical errors. in printname

nslog(@"the person's full name %@ %@",firstname,lastname); 

your format string wrong.

and in main

[person setlname:@"karimian"]; 

you have user "ser" instead of "set".


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -