objective-c

[NSCFString stringValue]: unrecognized selector sent to instance

Hello, I'm using this code to query core data and return the value of key, I store the value like this : NSString *newName= @"test"; [newShot setValue:newName forKey:@"shotNumber"]; and I query like this : NSManagedObject *mo = [items objectAtIndex:0]; // assuming that array is not empty NSString *value = [[mo valueForKey:@"...

How to change video orientation for AVCaptureVideoDataOutput

Hi. Here's the problem. I am using AVCaptureVideoDataOutput to get video frames from camera and make video from them with AVAssetWriter. Its working OK, but the video that I get is upside down because default orientation of device for my app is landscape left, not landscape right as its stated by default in AVCaptureVideoDataOutput. Im t...

Iphone: Passing objects and Multiple threads

Hi, Im having some trouble passing an NSNumber object to different threads. I call a function on viewDidload that loads up some objects from core data as a background process. which calls another function which loops through the loaded objects to see if there are any images associated with it alredy downloaded. if its not present, downlo...

How do I validate that an NSData is a PDF?

In working on a feed-reading iPhone app which displays nsdata's (html and pdf) in a UIWebView. I am hitting a snag in some PDF validation logic. I have an NSData object which I know contains a file with .pdf extension. I would like to restrict invalid PDFs from getting any further. Here's my first attempt at validation code, which see...

How to get content from URL asynchronously?

I'm trying here to create NSXMLParser from content of URL, it work perfectly well but is there way I can make URL content to be received asynchronously and later create NSXMLParser? NSURL *url = [[NSURL alloc] initWithString: @"http://www.Xmlfile.com"]; NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:url]; [url release]...

Binding returns default value (set with registerDefaults:) instead of zero

Here's my setup: myTextField is bound to a key in the Shared User Defaults Controller. The user can only enter numbers in the text field. Each time my application loads, I load default preferences (from the app's Resources folder) using [[NSUserDefaults standardUserDefaults] registerDefaults: ... ]. myMenuItem's title is bound to the s...

Guide about subclassing

Hi! I'd like to create a subclass of UIAlertView to implement my own defaut behaviors when users click on the dialog's buttons. It would be awesome if someone would guide me through it or just point me to some guide about subclassing? Thanks! ...

What's the difference between an C# Interface and an Objective-C Protocol?

What's the difference between a C# Interface and an Objective-C Protocol? I ask because I'm diving into ASP.NET MVC and I'm trying to grasp some of the new concepts and it will help if I can relate them to my Objective-C iOS programming background. Thanks for your help! ...

Adding a UIView below the screen

I have a UIViewController added using addSubview hanging out on top of another UIViewController. I would like the added view to hang out below the screen to be called up with a nice animation when I need it. Is there a way to add a subview to a screen at a certain location? ...

mutableCopy memory leak

Can anyone shed some light as to why this use of mutableCopy is leaking memory? - (id)objectInListAtIndex:(unsigned)theIndex { NSSortDescriptor *descriptor = [[[NSSortDescriptor alloc] initWithKey:@"noteNumber" ascending:YES] autorelease]; [list sortUsingDescriptors:[NSArray arrayWithObjects:descriptor,nil]]; NSMut...

Formatted Text in UIScrollview

Hi all, What i Need to do for our project is to Display several UIScrollViews in a View and weithin the scrollView a Headline and a Short Text. I Know how to add a Label to the UIscrollview, but how Gould i handle the Case that the Headline-Label is too Long and wraps to a Second Line. ...

iphone app communication without using webservices

I want to send some Text plus a image from one iphone application to other iphone app but restriction is I should not use a web server in between communication,Is there any way to fulfill it ? Details: There are two independent devices and could be far enough say out of network. My requirement one app adds some text with a image and ...

NSCFArray length]: error, array regex

StringReply = [[NSString alloc] initWithData:dataReply encoding:NSUTF8StringEncoding]; //Regex Out Artist Name //NSString *regEx = ; NSArray *iTunesAristName = [stringReply componentsMatchedByRegex: @"(?<=artistname\":\")([^<]+)(?=\")"]; if ([iTunesAristName isEqual:@""]) { NSLog(@"So...

NSTimer not invalidating or is refiring

so here is the problem i have, i created two NSTimer objects and they are fired when i button is pressed. then the user has 20 seconds to press another button which forces an alert to popup where they enter a validation code, and when they press the confirm button on the alert it is supposed to stop the timer. what is happening is that ...

regex to get string within 2 strings

"artistName":"Travie McCoy", "collectionName":"Billionaire (feat. Bruno Mars) - Single", "trackName":"Billionaire (feat. Bruno Mars)", i wish to get the artist name so Travie McCoy from within that code using regex, please not i am using regexkitlite for the iphone sdk if this changes things. Thanks ...

Why does this leak memory?

UPDATED I have this method: -(NSDate*)roundTo15:(NSDate*)dateToRound { int intervalInMinute = 15; // Create a NSDate object and a NSDateComponets object for us to use NSDateComponents *dateComponents = [[NSCalendar currentCalendar] components:NSMinuteCalendarUnit fromDate:dateToRound]; // Extract the number of minutes ...

How to convert quaternion to angle?

Is there a formula to convert a quaternion to an angle? Looking to do something on the iPhone using the Core Motion API and the gyro so that based on data I receive from it (in the form of quaternions) I can project a UIView on the screen. Thanks ...

Reloading tableView when subclassed causing crash

Hey guys! I have some problems reloading my tableView. I have subclasses my tableView, with a class called RadioTable. I have also subclasses my TableViewCells, but thats not important here. I need to point out that i'm pretty new, and built my subclass from some tutorials and stuff. First of all, here is the error message i'm getting ...

Can you access the actual identifier from an enum element's numerical value?

Is there a method to return the identifier string for a given element's numerical value? For instance, logging a UITouch's phase returns an int, but having the actual string value would be easier to read. I suppose I could write my own switch statement to do this, but I'm hoping there's a built-in means. ...

Objective-c: requesting aid in understanding how to use files/objects effectively.

Hello. I am sorry to bother so late, but i am very much a bundle of nerves. I have tried to understand how to use the information in the couple of objective-c and objective-c game design books I have purchased, but unfortunately, the information is laid out in a way which I dont really comprehend. I would like to state my query and is...