objective-c

-ObjC Flag in Xcode Issue

Hi all, I am trying to build a simple iPhone app that calls several static libraries. However, it seems when I include the linker flag "-ObjC" and "-all_load" (as I need to for one library), it causes the linker error: ld: duplicate symbol _OBJC_METACLASS_$_ASIFormDataRequest in /Users/XXXXX/Projects/AppName/Dependencies/Library1/lib1K...

iOS4 breaks my app [solved]

Hey, On all iPhones (we checked) which have been updated to iOS4, our app is behaving differently (buggy) than on previous OS version (3.1.3). First and most biggest problem is that on 3G (but not on 3GS), any UIAlertView freezes the app - actually it looks like that app losses focus to give it to UIAlertView, but UIAlertView doesn't ge...

How to create multi-column text layout for iPad?

Hello, I'm looking for a way to create kind-of an article reader which would have 2-3 columns of text which could occasionally wrap about some image. Just like it's done in "New York Times" or "Wall Street Journal" and other iPad applications. Also, that text should be paged and every page should have UITableView at it's side (just li...

Sending large amounts of data with NSFileHandle

So I'm using Apple's PictureSharing/PictureSharingBrowser samples to send and receive data. This uses an NSFileHandle on the server side to send a picture using NSFileHandle's writeData method. NSFileHandle * incomingConnection = [[aNotification userInfo] objectForKey:NSFileHandleNotificationFileHandleItem]; [[aNotification object] acc...

iPhone: Force UIButton to redraw itself

Hi, I have a little problem and I would be gratefull if someone could help me. I got 5 UIButtons placed next to each other and what I wanna do is set image on first button, redraw it so it, wait for 1 second, then set some other image on second button, redraw second button and so on. I tried to set image on button, then call function sle...

Trouble converting NSNumber to int

Hi, Sorry about this silly question. I'm trying to learn objc and I'm unable to do a simple sum between 2 int values... In fact problem is before the sum. I have an object that have an instance variable defined as a NSNumber and it's defined as a property as follows: @interface MyObj : NSObject { NSNumber *count; } @property (readw...

OpenPGP library

Is there a library to create OpenPGP keys, or to encrypt a file using OpenPGP? ...

Encryption library for Objective-C

Other than OpenPGP, are there any other libraries to encrypt text? ...

Creating a disk image (.dmg) from Objective-C

Is there any library to create a disk image from Cocoa, or is it only possible through Finder? ...

How can I determine if a compiled Objective-C app is using garbage collection?

For any application that I have on my Mac, is there a way to tell if it was compiled with GC enabled, or if it's doing manual memory management? ...

UIAlertView and Core Data

Hi to all of stackoverflow, i'm Italian so, i'm sorry for my bad English... :D i tried to create a simple tableView for listing a few names and a number... all with core data. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { Track *track = [[self fetchedResultsController] objectAtIndexPat...

How to generate a serial number (registration number)

What is the best way to generate a serial number users can use to register an application? I was thinking to the following scenario: Users try the application. When they want to buy the application, they select a menu item. The application generates a code that is then passed to the web site to buy the application. Users enter the cod...

Resizing a window after adding views programmatically

Hello, I am trying to come up with a way to display a window that contains at least one view (that contains two labels, and maybe a progress indicator) and can resize as more views are added. So, when a method is called, an array is passed in and depending on the number of entries in that array, that many views are added to the window...

Pass data between ViewControllers in a UINavigationController

(Continued from this thread) Suppose that I have the following view created: The 'View' button is supposed to push a new ViewController which will show all photos by either Josh or Al, depending on which button is pressed. My question is: In the ViewController code, how do I determine which 'View' button is pushed (top or bottom)? ...

NSMutableArray arrayWithCapacity vs initWithCapacity

I'm an iPhone/Objective-C newbie with an extensive Java background. I'm learning more about memory management in objective-c and I'm reading Apple's documentation on Memory Management: http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/MemoryMgmt/MemoryMgmt.html In the Object Ownership Policy section, it says that...

UITabBar in iPad - Won’t go into landscape mode

UITabBar in iPad - Won’t go into landscape mode.. ...

NSArray sort with custom objects

I have the following class: typedef enum eItems { kItem1, kItem2, kItem3 } MyItem; @interface MyClass: CCSprite<CCTargetedTouchDelegate>{ ... MyItem mClIt; ... } ... - (NSComparisonResult)MyCompareFunc:(MyClass*)inObject - (MyItem)GetSomeItem; ... And function for sorting: - (NSComparisonResult)MyCompareFunc:(MyClass*)inObject {...

Memory leak problem .

Hi guys, I am getting leak at: NSString *searchText = [aSearchBar.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; Can anyone suggest how to get out of this memory leak. ...

Iphone SDk Sound On/off Using UISwitch Button ?

how can i turn on/off sound in iphone sdk using UISWITCH button ? ...

C++ question: feature similar to Obj-C protocols?

I'm used to using Objective-C protocols in my code; they're incredible for a lot of things. However, in C++ I'm not sure how to accomplish the same thing. Here's an example: Table view, which has a function setDelegate(Protocol *delegate) Delegate of class Class, but implementing the protocol 'Protocol' Delegate of class Class2, ...