objective-c

How can I play a music such that it automatically replay it after its end?

AVAudioPlayer *myExampleSound; NSString *myExamplePath = [[NSBundle mainBundle] pathForResource:@"myaudiofile" ofType:@"caf"]; myExampleSound =[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:myExamplePath] error:NULL]; myExampleSound.delegate = self; [myExampleSound play]; How can I play myExampleSound such that...

Push Notification in Iphone application.

Hi All. I need to implement push notification in my application. Actually i have to receive messages from the server. Kindly guide me how i can implement push notifications in my iphone application. ...

MPMediaickerController memory leak identified by Leaks instrument

This is code from Apple's Addmusic example. MPMediaPickerController *picker = [[MPMediaPickerController alloc] initWithMediaTypes: MPMediaTypeMusic]; picker.delegate = self; picker.allowsPickingMultipleItems = YES; picker.prompt = NSLocalizedString (@"Add songs to play", "Prompt in m...

How to know in Xcode how much memory occupied by my object graph?

I have one big object graph. It begins from one root object and its properties are arrays which consist of other objects and so on. I want to know how much memory is eating by this graph at all. Have Xcode any instrument that will show me this information by root object (maybe something like tree of all my objects)? Or maybe it is poss...

how can i define NSTimeInterval to mm:ss format in iphone?

how can i define NSTimeInterval to mm:ss format? ...

iPhone: how to support vertical scroll in UIPageControl

Hi, thanks in advance. I have three UITabelView in a UIPageControl, but I could't scroll the UITableView vertically, can anyone tell me how to support this feature in this scenario? Or mission impossible... Regards, xiaojun ...

Can we add UILabel to splash screen in iphone?

Hi experts, Can we add an view to the splash screen in iphone?. I have a default.png file in my resources directory but when the splash screen pops up i want to display an text on the splash screen image is it possible in code. ...

Access a viewControllers View

Hi, I am trying to get to grips with programmatically configuring views. I have a UIViewController and want to add a UIButton to its view. Well, I created the button: UIButton *newViewButton = [[UIButton alloc] initWithFrame:CGRectMake(baseX + viewPlusX, baseY + viewPlusY, viewWidth, viewHeight)]; [newViewButton setTitle:@"View" forSta...

Handling multiple UISwitch controls in a table view without using tag property

I have a table view controller with multiple UISwitch controls in them. I set the delegate to the table view controller with the same action for all switches. I need to be able to determine what switch was changed, so I create an array of strings that contains the name of each switch. The indexes in the array will be put in the tag prope...

how can i display current time on a label ?

how can i display current time on a label iphone? ...

Two dimensional array search in objective c

Hi All, i want to ask question that how can we search in a plist which is of array type and has elements of array type as well. i am searching from a plist which is of string element type and its working fine, but i am not able to search when it has array elements in the plist. Regards! ...

How to change the Title of the searchbar cancel button in Iphone sdk?

Hi guys, I want to change the title of the search bar cancel button to Offers .Is there any method to change the title of the cancel button . Can any one giv me suggestions with sample code? Anyone's help will be much appreciated. Thank you, Monish. ...

function with multiple arguments

Hi, how to pass multiple arguments in a single function in Objective-C? I want to pass 2 integer values and the return value is also integer. I want to use the new Objective-C syntax, not the old C/C++ syntax. ...

Block declared variable visible outside?

If I declare a variable within a block (see below) is there a way to specify that its visible outside the block if need be? if(turbine_RPM > 0) { int intResult = [sensorNumber:1]; NSNumber *result = [NSNumber numberWithInt:intResult]; } return result; or is the way just to declare outside the block scope? NSNumber *result = n...

How to access ivar from class method of other implementation file

The title says it all, how do I access properties (title, state,...) of instance variables from within a class method of an other implementation file? I tried @synthesize but I couldn't get it to work. To be more precise; I need to access IBOutlets of an NSWindowController class. ...

What is differences between category and extensions in objective-c i am confused any good articles for that..>?

Hi i am confused with category and extensions in objective-c any good articles for that Thanks in advance. ...

how to set backgroundcolor of UIViewController in iphone ?

how to set backgroundcolor of UIViewController in iphone ? ...

How to make autorotation for Action sheet in Iphone sdk?

Hi guys, Here Im got a problem that is to my view I used the autoroation its working fine in both Landscape and potrait but my problem here is I had a button in my navigation bar when I click on to the button an action sheet will generate.when I rotate the view into lanscape the action sheet is not rotating in lanscape mode. can any on...

Should I mix wxpython and pyobjc ?

I have a wxPython based app which I am porting to Mac OS X, in that I need to show some alerts which should look like native mac alerts, so I am using pyobjc for that e.g. import Cocoa import wx app = wx.PySimpleApp() frame = wx.Frame(None, title="mac alert test") app.SetTopWindow(frame) frame.Show() def onclick(event): Cocoa.CFU...

iPhone SDK: Downloading large files from a server into the app's documents.

Hi, I am building an app that plays multiple video files, But I would like to know How do you download a video file (100mb - 300mb) from a server into the application's documents so it can later be locally referred to in code? The reason I want this type of a set up in my app is that I don't want the app binary to be made unnecessarily l...