objective-c

Why is prepareWithInvocationTarget: specific to NSUndoManager?

Compare... NSInvocation* invocation = [NSInvocation invocationWithMethodSignature:[performer methodSignatureForSelector:@selector(playFile:)]]; [invocation setSelector:@selector(playFile:)]; [invocation setTarget:performer]; NSString* string = [NSString stringWithString:@"reverse.wav"]; [invocation setArgument:&string atIndex:2]; ...w...

Target a UIButton by it's title

I am setting the title of a UIButton dynamically using [btn setTitle:x forState:UIControlStateNormal]. Is it possible to say for instance, change the background image of that button, but reference it by its title name? ...

Add UIStuff in an UIView

Hi, I want to add my buttons in a UIView, like then I can hide or not them. My button's code: carte1J1=[UIButton buttonWithType:UIButtonTypeCustom]; carte1J1.tag=11; carte1J1.frame=CGRectMake(60, 240, 50, 73.0); [carte1J1 setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",imagecarte1] ] forState:UIControl...

Does NSArray initWithObjects: retain objects?

When adding objects to an NSArray using "initWithObjects" can anyone confirm for me that the items are retained. I am pretty sure they are, but can't find it mentioned anywhere with regards to initWithObjects? // CREATE DRINKS Coffee *drink1 = [[Coffee alloc] initWithName:@"Flat White"]; Coffee *drink2 = [[Coffee alloc] initWithName:@"C...

make previously created classes part of an object graph in core data

I have an iPhone project with several classes I need to make NSmanagedObjects so I can use them with Core Data, I know how to create new classes from the model, but is there a way to do the opposite, link the classes with the object model graph. ...

ASIFormDataRequest NULL response

Hi all, i have simply form request in my Obj-c code, which calls a PHP code from my server ASIFormDataRequest *req = [[ASIHTTPRequest alloc] initWithURL:url]; [req setPostValue:[NSString stringWithFormat:@"%f",slat] forKey:@"mylat"]; [req setPostValue:[NSString stringWithFormat:@"%f",slng] forKey:@"mylng"]; [req start]; NSLog(@"respon...

iphone sdk: How to implement deletion animation from apple's notes app?

hi, is there a way to somehow use the same animation apple in the notes app, when notes are deleted? The same animation is used again in the camera app and is triggered when you delete a pic. Can anyone help me out on this? thanks in advance! ...

Why is WebKit written in C++ and not in ObjectiveC

Apple is the backing force of ObjectiveC. However WebKit is written in C++. Apart from portability (not all systems have ObjectiveC compilers/runtimes) is there any other valid reason for this? Performance, features? Lately Apple does not seem to care of other languages than ObjectiveC. ...

How to use the YAJL for objective c

Hi can any one tell the steps to use the YAJL to parse the json object in objective c Thanks.. ...

Casting of objects to dynamic types at runtime

I have the following code: + (UITableViewCell *) createTableViewCell: (NSString *) cell_id withTableView: tableView { SomeViewClass *cell = (SomeViewClass *)[tableView dequeueReusableCellWithIdentifier: cell_id]; if (cell == nil) { NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed: @"AViewCell" ...

Is Multitasking Enabled iPhone SDK

Hi, Please could you tell me how I could find out if multitasking is enabled on the iPhone. I am using Xcode. ...

Free Ram Xcode (iPhone SDK)

Hey, I am having some trouble finding out how to free ram on the iPhone using Xcode and the iOS SDK. If anyone could give me a hand doing this that would be great. Thanks in advanced. ...

UITableview fixed content group sections based on array size

I have a dataset that I wish to display in fixed size grouped sections. The sections each consist of three rows, a header, a switch and a text field. Each section represents a dictionary (constructed from my coredata 'records') The number of 'groups' that I need to display depends on the count of objects stored in my coredata store. T...

Shrink and Crop a UIPickerView in iOS4

How do you shrink a UIPickerView in iOS4? Nothing works for me: - Changing the frame value in the .xib as text - Setting the frame I can shrink using a transform, but I want to hide the background and see only 3 or 1 rows. Yes, this question has been asked before .. http://stackoverflow.com/questions/3209895/catransition-how-to-clip-to...

How to add a socket as QTCaptureOutputs for a QTCaptureSession

I'm reading Apple's documentation on using QTKit to capture streaming audio and video from input sources. I read that the central class QTCaptureSession handles the input and sends it to every possible output (QTCaptureOutput). The documentation lists six subclasses of QTCaptureOutput (e.g., QTCaptureMovieFileOutput). I would like to cr...

Objective-C property release error

Hi, what could be causing this crash? From everything I've read, I'm using the property correctly. When I call the method loadDot2Dot a first time, it works fine. Then when I go back to the main menu (call loadMainMenu) and try to load the dot2DotVC again (call loadDot2DotVC again), I get a crash (Exc_Bad_Access) - with no further info. ...

Trying to understand QTCompressionOptionsWindowTest

Hi, I'm trying to build an application that uses QTKit, with some compress options. I saw this example in the apple developer page QTCompressionOptionsWindow that uses a Window for that purpose. in MyController.m line 65 there is a comment: // ******** Compression Options Window ***** // create our window with the media type and se...

Comparison operators not functioning as expected

Hello! I have a set of checks to perform certain tasks. // tempDouble is a (double), hour is an int if (tempDouble > 60.0 && (hour >= 6 || hour <= 17)) { //CLEAR NSLog(@"CLEAR"); } else if (tempDouble > 60.0 && (hour < 6 || hour > 17)) { //NIGHT_CLEAR NSLog(@"NIGHT_CLEAR"); } else if (tempDouble <= 60.0 && (hour >= 6 || hou...

Application crashes after trying to set typedef enum

Hello there! I had asked a question similar to this before, but I have a new problem with it so I've reposted part of the question. I have this before the interface declaration in my MainView.h header. typedef enum { UNKNOWN, CLEAR, NIGHT_CLEAR, CLOUDY, NIGHT_CLOUDY } Weather; Then I declared it (in my MainView) like this: Weather...

Does anyone have any solutions for playing an ASF stream in an iPhone app?

As a part of my app I'm building, I'm trying to add a radio feed, and the radio station in question only supplies an asx/asf stream and has no plans to support anything else, so I have no access to change any of the source stream. Obviously, reading an ASF stream using the default libraries does not work, as the iPhone does not support ...