objective-c

how to perform filtering of nsarray in objective c

i have a NSMutableArray which contains objects. how to perform filtering operation on it. ...

How to get the duration of the audio file recorded in the Iphone sdk?

Hi Guy's I need to get the Exact duration of the audio I recorded using the AVAudioRecorder and need to print the duration can any one suggest me with a sample code? Hope I will get a quick response from your side. Thanks in advance, Monish. ...

How to check the NSString contains the '%' or not?

Hi, everyone, I want to ask a question about the objective C. Does the NSString * contains some functions to check the NSString * contains some string in the UITextField.text? For example NSString *checkString = @"abcd%" if(checkString contains '%') // I want this function return YES; else return NO; ...

Is this possible with NSDictionary? Or should I use something else?

What I am trying to do is create a an array of text strings, and I want to select a random text string out of this array, which I could normally do easily with an array. However, I would also like to be able to put them into categories, and when I select a random one, I would like to know what category it is in and do something different...

Foundation tool OS X Service, Garbage Collection, MacRuby: why my NSRunLoop won't loop in acceptInputForMode:beforeDate:?

I'm writing an OS X Service with MacRuby. It upcases the selected text. It mostly works, but… well, here's all of it: #!/usr/local/bin/macruby # encoding: UTF-8 framework 'Foundation' framework 'AppKit' class KCUpcase def upcase(pasteboard, userData: s_userdata, error: s_error) incoming_string = pasteboard.stringForType "public.u...

When should I release memory?

How do I decide when I should release memory? Because If I release the memory, many times the application crashes. ...

Delegate Protocol doubt?

hi, I want to use my own delegate methods. i follow the tutorial .but is it must to use the class in which i have declared delegate method(protocol definition) for calling that delegate method?cant i call without creating the object for the class in which i have protocol definition? what is the use of the method "delegate respondsT...

How Do I write a Timer in Objective-C?

I am trying to make a stop watch with NSTimer. I gave the following code: nst_Timer = [NSTimer scheduledTimerWithTimeInterval:0.001 target:self selector:@selector(showTime) userInfo:nil repeats:NO]; and it is not working in milliseconds. It takes more than 1 millisecond. ...

how to parse XML which contains data in Norwegian language ?

how to parse XML which contains data in Norwegian language ? Does i need any type of encoding with NSParser ? Thanks. ...

How to update a NSString?

Hi, everyone, I want to ask a objective C question. I have a string retrieve from UITextField and I want to check the string contains the '@' or not. However, when I use the following code, it has some errors, can anyone help me? Thank you. if([inputTextField.text rangeOfString:@"%"].location != NSNotFound) NSLog(@"It does not cont...

isMemberOfClass problem

Hi All, I'm trying to log if an object in my mutable array is a member of the class NSString. Here is my code: id obj = [mutArr objectAtIndex:1]; BOOL classMem = [obj isMemberOfClass:[NSString class]]; NSLog(@"%@", classMem); Instead of printing YES or NO, I get the output (null). Can you please tell me why this is the case? Than...

UIButton as part of UITableViewCell subview - make it work...

Hi all, I'm having some class which is a subclass of UITableViewController. on one of the TableView's cell I'm adding a view that holds a UIButton as subview (i.e. [someParentView addsubview:button]) I'm adding the view to cell like this: [cell.contentView addSubview:someParentView] I've set the UserInteractionEnabled both for the butt...

Landscape mode in chipmunk/cocos2D

hi, I'm trying to create a chipmunk space with a bouncing ball.(Example seen here) Currently my device is running in Landscape mode. So according to cocos2D everything is all right. When adding Sprites they orient to landscape mode. [director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft]; The only problem is that the ...

Sending data between OSX and iPhones/iPads

Hi, I am wondering how I can send data between a machine and a mobile device. I know about the game kit an have read a bit about bonjour (but don't know to much about it), but would like to know some expert thoughts on what the best way is. What I basically want to build is a one way traffic application that sends data from OSX to the ...

What are faulted entities in Core Data?

Hi guys, What are faulted entities and what the difference between them and 'usual' entities? where can I read about that? Thanks ...

iphone - digital image processing

I want to build an app similar to Fat Booth, Aging Boot etc. I am totally noob to digital image processing. where should I start? Some hints? ...

How to know the displayed text in UILabel ?

Hi, I have an UIView containing two UILabels, in order to display a string. The first UILabel has a fixed size, and if the string is too long and can't hold in this UILabel, I want to display the maximum characters I can in the first UILabel, and display the rest of the string in the second UILabel. But to make this, I must know the ex...

[iPhone dev] NSPredicate with NSDate and repeats (like Calendar app)

Hi, I have an entity "Event" witch contains two properties: date (NSDate) and repeat (NSInteger - 0 = NONE, 1 = DAILY, 2 = WEEKLY, 3 = MONTHLY, ...). Does anyone knows how can I filter events by repeats passing a date ? Example: First event: 01-01-2010 / weekly Second event: 10-02-2010 / monthly Current date: 10-06-2010 Re...

how to rotate UI segmented control

hey all i want to know rotate the UI Segmented control to be in a vertical look cheer BOB ...

Objective-C changing random values for variables

This really is my last resort as I am absolutely stumped and I just know it is something stupid! I have a UITableView and a UISearchBar, the user uses the search bar to enter a location, which is then appended to a url with page=1. This is then sent to an api and a list of adverts are returned (this has been successful). The user can th...