iphone - iOS Beginners Question -


i have updated 1 question removing hud items. looking split 1 line of code two.

i have call:

[service2 performinsert:self action:@selector(performinserthandler:) applicationid: applicationid imagedata: uiimagejpegrepresentation([self.capturedimage objectatindex:0], 0.5) imagedatatype: @".jpg"]; 

i split similar pretty new objective-c.

[service2 performinsert:self action:????? applicationid: applicationid imagedata: uiimagejpegrepresentation([self.capturedimage objectatindex:0], 0.5) imagedatatype: @".jpg"];   [self performinserthandler:????]; 

here service2 method:

- (soaprequest*) performinsert: (id <soapdelegate>) handler applicationid: (int) applicationid imagedata: (nsdata*) imagedata imagedatatype: (nsstring*) imagedatatype         {             return [self performinsert: handler action: nil applicationid: applicationid imagedata: imagedata imagedatatype: imagedatatype];         }   - (soaprequest*) performinsert: (id) _target action: (sel) _action applicationid: (int) applicationid imagedata: (nsdata*) imagedata imagedatatype: (nsstring*) imagedatatype         {             nsmutablearray* _params = [nsmutablearray array];              [_params addobject: [[[soapparameter alloc] initwithvalue: [nsnumber numberwithint: applicationid] forname: @"applicationid"] autorelease]];             [_params addobject: [[[soapparameter alloc] initwithvalue: imagedata forname: @"imagedata"] autorelease]];             [_params addobject: [[[soapparameter alloc] initwithvalue: imagedatatype forname: @"imagedatatype"] autorelease]];             nsstring* _envelope = [soap createenvelope: @"performinsert" fornamespace: self.namespace withparameters: _params withheaders: self.headers];             soaprequest* _request = [soaprequest create: _target action: _action service: self soapaction: @"http://tempuri.org/xxxxservice/performinsert" postdata: _envelope deserializeto: [[xxxinsert alloc] autorelease]];             [_request send];             return _request;         } 

is there way asking? thank can provide.

consider using this:

sel selector = [service2 performinsert:self                                  action:@selector(performinserthandler:)                           applicationid:applicationid                               imagedata:storedimage                           imagedatatype:@".jpg"] // show hud [hud setcaption:@"working..."]; [hud setactivity:yes]; [hud show];  nsobject result = [self performselector:selector withobject:nil];  // update hud [hud setcaption:[nsstring stringwithformat:@"done %@",result]]; [hud setactivity:no]; [hud setimage:[uiimage imagenamed:@"19-check"]]; [hud update]; [hud hideafter:2.0]; 

this example uses atmhud. should name methods in lowercase, blah:blah: instead blah:blah. , avoid writing nested sentences 225 characters long.


Comments