objective-c

What is dealloc in objective C

Hi, everyone, I want to ask an general question about the objective C. When I write the program of the iPhone application, I always see a function called 'dealloc' in the .m. when will this method be called? do I need to put all the [release] in here good for the application? thank you very much. // ------------------ updated content ...

iPhone with a credit card swipe in machine.

Hello friends, I wonder how can we connect a iphone device to credit card swipe-in machine .Thus, any user swipes the card through credit card swipe-in machine,all the credit card details get transferred and stored in the phone device that can be used to confirm the payment transaction by user. The user can even use these as complete tra...

Failing to parse JSON... is the encoding messed up?

I am trying to parse the JSON returned here: http://www.waterwayguide.com/map/php/bridge.php?ll=25.514339,-80.076164 However, I can't parse it as I normally would it seems: NSData *jsonData = [[(ASIHTTPRequest*)[data objectForKey:@"request"] responseString] dataUsingEncoding:NSUTF32BigEndianStringEncoding]; NSLog(@"this prints as expe...

How to remove th COPY UIMenuItem in UIMenuController

Hi Guys, I am developing an iPhone application and worked with UIWebViews. I planned to customize the UIMenuItems thats popped up when i highlight strings in UiWebView (Copy, Select All, Cut, etc.). I tried removing those menuItems but i cannot remove the COPY menu item. I need your help guys. Thanks, ZaldzBugz ...

Negotiating TLS with ESMTP over sockets

I have a simple SMTP client, to which I am attempting to add TLS support. I am unsure as to what occurs after the client issues the 'STARTTLS' command. Most sources (including the RFC itself) describe it as the negotiation of a TLS session, but this is not particularly clear. How does one go about doing this? My client is written in ...

alloc + init with synthesized property - does it cause retain count to increase by two?

I've seeen the following snippet quite a bit: In the header: SomeClass *bla; @property(nonatomic,retain) SomeClass *bla; In the implementation file: @synthesize bla; and then self.bla = [[SomeClass alloc] init]; I think that this assignment puts the retain count for 'bla' up by two; once through the alloc/init call, then throug...

Drawing circle with stroke and fill color

how to draw a circle using CGContextAddArc with different sroke color and fill color? ...

problem in integrating facebook with iphone

how i can get template bundle id for my application which i have set up in facebook so that i can integrate my facebook properly with my iphone and how can i get a url path for retreiving friends in facebook ...

How to retrieve the address book content?

Hi, everyone, I want to ask an question about the objective C iPhone application. In my application, I would like to retrieve the content of the (e,g name, phone, email address) in to my application. But I have no idea about what I need to do? Can anyone provide some information, library or link for my to study? Thank you very much. ...

[UINavigationController popViewControllerAnimated:NO] doesn't release controller?

I have one UINavigationController that I use like this: DetailsViewController *controller = [DetailsViewController alloc] init]; [self.navigationController pushViewController:controller animated:YES]; [controller release]; Of course this code works well. The problem: when I send the popViewControllerAnimated: to the UINavigationCont...

Is it possible to do for loop backward?

I found it not correct to do this in Objective C. So anything wrong here? for (int i=10; i<=0; i--) ...

iPhone- Dynamically update NSDate for clock?

I've made a clock, and I'm trying to update it so it displays, well, the time. When I initiate the NSDate it is an instance of the exact current time, for the time it was initiated. So what I have going on here is pinging the updateTime function with an NSTimer to update the clock every 3 seconds. It seems that there should be a way to ...

Problem catching exceptions

Hey hey! I'm making an iphone based app and I have issues catching exceptions. So far, I've never had problem with try catches but here... well :D Here is the code that doesn't catch any exception : - (void)updateView:(NSTimer*)t { NSMutableDictionary *requestResult = [[[NSMutableDictionary alloc] init] autorelease]; @try {...

UITableView: delete section controls

Hello, Is there a way to add delete controls, like in UITableViewCell, on a table section? I see two ways: Use table cell instead of sections. Write own UIView section class, which will show delete controls. Regarding the first way - as I think, it could be an easiest way in my situation. The second way may be better from the imple...

Can a UIWebView web form be populated programmatically?

If you have a UIWebView, and load a web page with a form on it, can you programmatically populate that form? Either with objective-c or javascript, or something else? ...

How to modify the command XCode uses for creating the precompiled header?

Hi, I'm developing an iPhone application, and after making small changes to my code, when I tried to build I suddenly got the following build error when XCode tries to create precompiled header: i686-apple-darwin10-gcc-4.2.1: n: No such file or directory Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 fa...

Which is the best language to replace objective-c?

After reading Is a virtual machine for Cocoa programming inevitable?, I'd like know what is the language in your mind if the replacement really happens, and why? Fixable complaints in the language and APIs include the lack of tuples, slices, maps or associations at a syntax level; the lack of template programming; the ...

How to shift item location on screen after iPhone rotation.

I have a UILabel that I need to shift up by about 50 pixels on application start (because it starts out in portrait, and I designed it in landscape) and then once again whenever it is put back in portrait. Right now I'm using a CGRect based on its current frame. The problem is when I try to rotate the phone the frame uses the portrait va...

how to show unicode character in iphone application

hi all i am developing RSS application in which title are in Japanese language. i have grasped and display title in table cell but it is just showing me ? marks. ie ????????????? how to tackle this... the code by which i am recieving title and displaying it in table cell is below. int blogEntryIndex1 = [indexPath indexAtPosition: [i...

EXC_BAD_ACCESS in [window addSubview:viewcontroller.view]

Hi I have two universal applications... one is giving me an EXC_BAD_ACCESS error when i do this in the app delegate: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. ScrollViewController *vc = [[ScrollViewCon...