objective-c

How can I isolate third-parties' C/C++/ObjC libraries' symbols from each other?

I have a project that needs to incorporate two third-party libraries, libA and libB. I have little, if any, influence over the third-party libraries. The problem being is that both libA and libB include different versions of a common library, ASIHTTPRequest. As a result, I'm getting errors like: -[ASIFormDataRequest setNumberOfTimesToRe...

Updating UI Manually

Hi, Is there a way to update UI manually? For example, I have a function which updates UI and execute some logic. After the UI update, it will execute some logic that will take a long time and update of UI has to be wait until the execution of logic is finished. Is there a way to update UI manually befor even the logic is even executed?...

cocos2d ccsprite animation

Hey all Im working on an app for the iphone and i am new to cocos2d and objective c. Im having some trouble getting a sprite animation to be position as i want it. I have a background sprite and have a second animation sprite that goes over it. In this case the background is a person and the animation sprite is the eyes blinking. CGSiz...

Using AdvanceURLConnection in iPhone application.

Hi All, I wanted to use HTTPS in my application to communicate to API. But I did not want to use third party frame work like ASIHTTPRequest. So wanted to use the sample provided in AdvanceULConnection (http://developer.apple.com/iphone/library/samplecode/AdvancedURLConnections/Introduction/Intro.html)[can check sample here, hope the URL...

Objective-C Split()?

Hello! Is there any way to split strings in objective c into arrays? I mean like this - input string Yes:0:42:value into an array of (Yes,0,42,value)? Thanks! Christian Stewart ...

Dynamically loading NIBs?

Rather than having three separate controllers and their associated *.xib files I am trying to setup a generic controller and then instantiate it with one of three different xib files RED.xib" "GREEN.xib" & "BLUE.xib" NSString *nibColor; switch (selectedRow) { case 0: nibColor = @"RED"; break; case 1: nib...

Convert String to Int Objective-C?

Hello! Really basic iPhone Objective-C question. I'm trying to extract a string (which is really a int) from an array and then use it as an int in a function. I'm trying to convert it to a int using intValue. Here's the code I've been trying. NSArray *_returnedArguments = [serverOutput componentsSeparatedByString:@":"]; [_appDeleg...

Does pushViewController retain the controller?

I am struggling to find out if pushViewController retains the controller, currently I have the following code (which works) ... ColorController *colorController = [[ColorController alloc] initWithNibName:nibColor bundle:nil]; [[self navigationController] pushViewController:colorController animated:YES]; [colorController release]; but ...

basic math problem with Integer and NSDecimalNumber - Invalid operands to binary

Man the simplest stuff always seems so crazy in Objective-C to me, anyways I need to do some basic subtraction and multiplication and am stumped. I have: client.PricingDiscount <-- this is an Integer 16 property on a CoreData NSManagedObject sku.RetailPrice <-- this is a Decimal property on a CoreData NSManagedObject I am simply try...

Displaying progress indicator inside an NSSearchField

I am using a NSSearchField to run a query over the internet and display the results in a table view. Whilst the query is running I would like to display a progress indicator inside an NSSearchField? I think I have seen this done in another application before. Is there an open source component that I could use to accomplish this? How wo...

Using NSImage operation to make a crop effect

I have an NSView that display an image, and i'd like to make this view acts like a cropping image effect. Then i make 3 rectangles (imageRect, secRect and IntersectRect), the imageRect is the rect which show an image, secRect is rect which just act to darken whole imageRect, and the intersectRect is a rect which like an observe rect, wha...

iPad: Custom Toolbar for UISplitViewController

How exactly does one go about implementing a custom toolbar for the main table view section of a split view? The program I am writing for the iPad is landscape only so the split view has a static table view along the left side, and at the top is the toolbar with a title. It is this toolbar I would like to change. I have created the spl...

EXC_BAD_ACCESS Exception in iPhone

Hi there, i got this piece of code: - (void)postToWall { FBStreamDialog *dialog = [[FBStreamDialog alloc] init]; dialog.userMessagePrompt = @"Un tuo commento:"; dialog.attachment = [NSString stringWithFormat:@"{\"name\":\"Bla: %@\"", facebookName]; [dialog show]; [dialog release]; } the first time it get executed it works fine, no p...

[self class] in Objective-C

I'm reading through Mark Dalrymple's Learn Objective-C on the Mac (only at the chapter on Protocols, so still relatively newbish) and trying to figure something out: Why would you ever reference a class by its own name? If I had a class called Foo, why would I ever want to write, say, [[Foo alloc] init] and not [[[self class] alloc...

Writing my own @dynamic properties in Cocoa

Suppose (for the sake of argument) that I have a view class which contains an NSDictionary. I want a whole bunch of properties, all of which access the members of that dictionary. For example, I want @property NSString* title and @property NSString* author. For each one of these properties, the implementation is the same: for the gette...

UIView initWithFrame overwrite view height

Hi, I have a UIView with a NIB. The view in the NIB is set to 280 x 390. When I add the View inside another view I "something" do this view_name *view = [view_name alloc] initWithFrame:CGRectMake(0, 0, 280.00, 390.00) ]; [outer_view addSubview: view]; Now in certain instances I need to make the view smaller as there is other conten...

MJPEG in UIWebView - How to change scale with javascript (iphone)

I'm displaying an MJPEG stream in a UIWebView. I have two different sizes I want to use for the UIWebView. The video size is constant. So setScalesPageToFit isn't flexible enough, and I have no control over the source to change the viewport meta tag. So I'm left thinking that I need to do this via javascript (of which I have very lit...

viewWillAppear, viewDidAppear not being called, not firing

(This is both question and answer since it took quite a bit of digging to find the real answer.) Symptom: viewWillAppear, viewDidAppear were not being called in my UIViewController. Cause: Embedding a UINavigationController or UITabBarController (my case) in a UIViewController somehow interrupts with the calling of these methods. Sol...

Autorelease NSString

Am I responsible for releasing this string, and is it autorelease by default? // command is of type NSData* char cAddress[12]; [command getBytes:cAddress range:NSMakeRange(5,12)]; NSString *someString = [NSString stringWithCharacters:(const unichar*)cAddress length:12]; ...

How do I create a combobox type control on the iphone?

All I see is a list (which looks like a rolodex), how do I make this like the combo box option? ...