objective-c

when an autoreleased object is actually released?

Hi, I am new in objective-c and I am trying to understand memory management to get it right. After reading the excellent Memory Management Programming Guide for Cocoa by apple my only concern is when actually an autoreleased object is released in an iphone/ipod application. My understanding is at the end of a run loop. But what define...

How to post images with text in facebook integration in Iphone sdk

Here Iam having a problem.Actually I implemented the facebook integration in my application and I need to post the images with text but I dont have any idea how to work on this.can anyone suggest this with a sample code so that it is very helpful for me. Anyone's help will be much appreciated. ...

IS there any API in facebook connect like twitpic API in twitter to post images in Iphone sdk

Hi guys, Is there any API call for facebook connect like twitpic in twitter to post the images. Actually I need to post the Images and related status with in a single post. Please guys help me to get out of this problem. Anyone's help will be much appreciated. Thank you, Monish. ...

Memory leak at NSObject allocation

HI, I am getting memory leak at NSObject allocation i.e., ContactDTO* contactDTO = [[ContactDTO alloc] init]; Code: +(ContactDTO*) getContactDTOForId:(NSString*) contactId { NSString* homeMail =@""; NSString* workMail=@""; NSString *lastNameString=@""; NSString *firstNameString=@""; firstNameString = [AddressBookUtil getValueForP...

UISwitch propagate state

Hello, I'm still rather new to iPhone development and I tried something I didn't it was possible. I have a UIView for my TableView Section Header with a switch on it, and I also have a UITableCellView with another Switch on it. It all looks fine, but now I want to propagate the UISwitch state from the section header to all the UISwitches...

Objective-C: Database support

How can I connect to an Oracle database and SQL Server 2005-2008 database with Objective-C? ...

Object allocations in the cellForRowAtIndexPath method is increasing? Is dealloc not called in presentModelViewController?

Hi Guys, This is PresentModelViewController, when click a button i will get this "DoctorListViewController" controller from down. object allocation are not releasing in this controller specially in cellForRowAtIndexPath delegate method. UITableViewCell and two labels allocated in this is not releasing. In the previous view The allocat...

Tips on implementing a custom UITextView interface on the iPhone?

I am trying to implement a control to edit text that will display the text in multiple colors. None of the solutions I have attempted yet have been good enough. UITextView cannot accomplish this. All of the text must be the same color. Using CoreGraphics to draw the text does not allow the text to be selected. Using a UIWebView, DIV ...

How to hide an iPhone Tab Bar?

Hello! I have a small multiview app. It consists of a UITabBarController with a nav controller in each tab. What I want is to show a UIImageView when a user shakes the device. After I've implemented the loading of the UIImageView, I faced a problem-the image was only 2/3 of the screen because of the tab and nav bars. I managed to hide t...

Memory leak in mutablearray allocation

Hi I am getting memory leak in mutablearray allocation.. in NSMutableArray *contactsArray =[[NSMutableArray alloc] init]; CODE: +(NSMutableArray*)getContacts { addressBook = ABAddressBookCreate(); NSArray* peopleArray = (NSArray*) ABAddressBookCopyArrayOfAllPeople(addressBook); int noOfPeople = [peopleArray count]; ...

How to upload contents of a file to a UITextView?

Hello! I have about twenty UITextViews and corresponding .txt files. What I want is to make each UITextView take the contents of the corresponding file and display it. Moreover, the text is formatted and it contains some formulas (copy/pasted from Grapher). I've heard about displaying formatted text in UIWebView, but I haven't found a c...

Defined outlets, connected them, they all returns (null)

Hi! I'm trying to play with a WebView. I made an outlet: IBOutlet UIWebView *browser; Defined it as a property: @property (nonatomic, retain) IBOutlet UIWebView *browser; Synthethized it: @synthesize browser; Finally, I connected it in Interface Builder, really it is. Then I try to do something with it i.e.: [browser loadReq...

UIView Animation iPhone (obtaining information on the frame dynamically)

I have a UIView called goalBar which is being animated by increasing the size of the frame according to a float value called destination: CGRect goalBarRect = CGRectMake(0, 0, destination, 29); [UIView beginAnimations:@"goal" context:nil]; [UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; [UIView setAnimationDuration:2.0f]; goalB...

View doesn't respond to touches after shake

In my app I've implemented a shake event and it shows a UIImageView. When the UIImageView is shown, I hide the Nav Bar with: [self.navigationController setNavigationBarHidden:YES animated:NO]; And after that I want to bring it back when user touches the screen: - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { [[...

Confusion around NSMutableArray and NSArray

I have the following code: NSLog(@"items: %d", [items count]); NSLog(@"allObjects: %d", [self.allObjects count]); [self.allObjects addObjectsFromArray:items]; NSLog(@"allObjects: %d", [self.allObjects count]); Which produces the following output: items: 7 allObjects: 0 allObjects: 0 items is a NSArray allObjects is a NSMutableAr...

Is it dangerous to set off an autoreleased NSOperationQueue?

I have a task that takes a rather long time and should run in the background. According to the documentation, this can be done using an NSOperationQueue. However, I do not want to keep a class-global copy of the NSOperationQueue since I really only use it for that one task. Hence, I just set it to autorelease and hope that it won't get r...

NSString (hex) to bytes

Isn't there any method in Objective-c that converts a hex string to bytes? For example @"1156FFCD3430AA22" to an unsigned char array {0x11, 0x56, 0xFF, ...}. ...

Objective C -- passing array literal to a method

This seems to work (compiler doesn't complain, anyway): float adsr[4] = {0,1.0/PULSE_SPEED, 0,1}; [sequence setBaseADSR:adsr]; but I want to make it more concise and do this: [sequence setBaseADSR:{0,1.0/PULSE_SPEED, 0,1}]; How do I do it? In javascript, I'd call stuff in the brackets an "array literal". Not sure if C languages hav...

Get BoundingBox of a transparent Image?

Hi, i load a transparent .png into an UIImage. How to i calculte the real bounding-box. E.g. if the the real image is smaller than the .png-dimensions. Thanks for helping ...

iPhone XCode programming: execute code when change tab in a tab bar application

Hello! I'm developing a simple tab bar application for school. It has 3 tabs. One of them plays music in streaming and I would like to stop the music playing when the user changes the tab. Is this possible? and How? Thank you in advance! ...