objective-c

Drawing the UIPicker values from multiple components?

I have the UIPicker setup with multiple components and a button below it. Depending on what the user has chosen with the UIPicker determines which new view will be loaded but I am having trouble determining how to extrapolate the information from the picker itself. Right now I have this method being called when the button is pressed: ...

slideshow for images, prev, next buttons

Hi, I developed an application for my Image gallery.now, i need to make a slideshow for those images with Previous & Next buttons to switch between images. Do anyOne of you tried to develop with such functionality. Can any one of you provide me sample XCode project for my requirement?I would like to test it using iPhone-simulator. Any...

How to find out whether an image exists within a bundle?

I have an array of NSStrings: Flower Car Tree Cat Shoe Some of these strings have images associated with them; some don't. I can build an image name by appending .png to the name (e.g. Flower.png). How do I check whether that image actually exists within the bundle before I try to load it into the view? ...

Object declaration in Objective-C

Is there any difference in declaring objects in Objective-C between (1) and (2), besides the style and personal preference? (1) One-line declaration, allocation, initialization. Student *myStudent = [[Student alloc] init]; (2) Multi-line declaration, allocation, initialization. Student *myStudent; myStudent = [Student alloc]; myStu...

Objective-C Memory Management: When do I [release]?

I am still new to this Memory Management stuff (Garbage Collector took care of everything in Java), but as far as I understand if you allocate memory for an object then you have to release that memory back to the computer as soon as you are finished with your object. myObject = [Object alloc]; and [myObject release]; Right now I ju...

Can we call one iphone app from another iphone app?

Say, that i am clicking on one iphone app icon,when launched it will create one .app file.So is it possible to call one more iphone app from that app.Or can we do something in that .app file such that it will call another app. ...

How do I add an extra separator to the top of a UITableView?

Hi, I have a view for the iPhone that is basically split in two, with an informational display in the top half, and a UITableView for selecting actions in the bottom half. The problem is that there is no border or separator above the first cell in the UITableView, so the first item in the list looks funny. How can I add an extra separa...

how to implement facebook in my application for iPhone

hello I have complete code for implemention for facebook in my application But the problem arises as follow : Firstly whenever i import FBConnect\FBConnect.h the error will show that it doesn't "NO such file or direectory" secondly due to this error i have 182 error in my application.. Thanks ...

How to prepare a mail interface like mail in iphone.

Hi all, I want to prepare the mail interface for show mail and compose same as mail in iphone in my application. Please suggest me any idea for how I prepare the layout for show mail and compose mail. Thanks Deepika ...

C++ class in Cocoa

Any ideas why Xcode wont let me define a c++ class in my cocoa project? I am trying to use a C++ class in my cocoa project but I am getting build errors just creating the c++ header file. class SomeClass{ public: int count; }; Expected '=', ',', ';', 'asm' or 'attribute' before 'SomeClass' in ..... If I remove all code from the...

Writing a function for UIAlertView?

I'm sick of writing basic UIAlertView's, ie: UIAlertView *alert = [[UIAlertView alloc] initWith...]] //etc Instead of doing this, is it possible to put all this in a "helper" function, where I can return the buttonIndex, or whatever an alert usually returns? For a simple helper function I guess you could feed parameters for the title...

Lazy load images for UITableViewCells from NSDocumentDirectory?

Hey. I have a tableView in my app that I load in images to from the NSDocumentDirectory. It works, but when scrolling up and down, the app seems to freeze a bit. I know that this is because of the images getting loaded in, and not getting cached, but I don't know how I can load them in later, after they've been created. The images are ...

Grouped table with image in first row (and section), the remaining ones having text with different length

Hi I have a grouped table with two sections where I display text with different length and therefore cell height. I have solved the problem with the different length/height with constrainedToSize in cellForRowAtIndexPath. Now I want to add a section with one single row in which I want to show a picture. How should I best implement t...

What happens inside the try block?

Example: @try { // 1) do bad stuff that can throw an exception... // 2) do some more stuff // 3) ...and more... } @catch (NSException *e) { NSLog(@"Error: %@: %@", [e name], [e reason]); } If 1) throws an exception, is the block immediately canceled like a return in a function or a break in a loop? Or will 2) and 3) ...

how to push view to view based application?

HI I am working with View Based application, i need some suggestions from you, 1) is it possible to push a view using navigationcontroller in view based application. 2)when should we need to use navigationbased application,viewbased application,windowbased application. 3)in viewbased application i know we can addsubview, but can we...

Must I explicitely enable exceptions in Xcode?

-objectWithID: is supposed to give me an object that's broken when the ID doesn't exist. The documentation says, that this object throws an exception when I try to access an property. However, it never throws any. Must I enable exceptions so that they're really thrown? Here's some code: // Assume: a new managed object has been created...

UITableView: block cell dragging during reordering

Hi I've a problem with UITableView. When I'm in editing mode i want to reorder the cell but e when I drag a cell at the bottom of the screen it's allowed to go down as much as the TableView height and down the last tableViewCell. I've only 4 cell and i want that when Im dragging a cell it's not allowed to go down after the fourth cell. ...

How to set x coordinates as hours in core plot

I am drawing a ScatterPlot using core-plot framework. My x coordinates are hours starting from 0 AM to 12 PM . How i can set these as my x coordinates ? please help me .. thanks in advance . ...

where to write syntax for nsmutable dictionary. can u give me an example

i m new to xcode. can ny1 tell me dat hw can i use nsmutable dictionary. where its syntx start me. kindly provide an example to ...

Converting 'x' value of a CGPoint ivar to NSTimeInterval?

Hi I have a velocity ivar defined as a CGPoint. I need to somehow extract just the 'x' value of velocity, and then use this to call-send a message to the following method signature -(void) adjustTimer:(NSTimeInterval*)newInterval How do I obtain just the 'x' value of a CGPoint? Do I then need to convert or cast this result before ca...