objective-c

Audio stream and QTKit error

I'm trying to stream audio from the web with QTKit. I used this code: movie = [[QTMovie alloc] initWithURL:[NSURL URLWithString:@"http://vipicecast.yacast.net:80/vra_webradio07"] error:&error]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(movieStateDidChange:) ...

How do I make my own recordedPath in GLPaint Sample Code

Hi, I've recently downloaded the GLPaint sample code and looked at a very interesting part in it. There is a recordedPaths NSMutableArray that has points in it that are then read and drawn by GLPaint. It's declared here: NSMutableArray *recordedPaths; recordedPaths = [NSMutableArray arrayWithContentsOfFile:[[NSBundle mainBundle] p...

Prep for Beginning CSIS: Java Programming

I am going to begin my Computer Science & Information Systems degree in April. My first class is an introduction to Java programming. Lately I have had an interest in Objective-C, but slowly declined due to lack of persistence and comprehension difficulties, (mostly some OOP). Obviously I would like to do well in my classes, so I am ask...

Grouping a Core Data data result?

I am prototyping an idea on the iPhone but I am at the SQLite vs CoreData crossroads. The main reason is that I can't seem to figure out how to do grouping with core data. Essentially I want to show the most recent item posted grouped by username. It is really easy to do in a SQL statement but I have not been able to make it work in co...

Objective-C: Do You Have to Escape Single Quotes in Strings Destined fo SQL?

Hi, I'm an iPhone developer. I'm writing my unit test cases, one of which checks if the app accepts UTF8 strings to be written to a sqlite3 database. I created a test case to generate random UTF8 strings and I can see the ones that fail do so because they contain an apostrophe (') which I need to be accepted. I'm writing to the databa...

Objective-C: How to Call a Instance Method

Hi all, I need to call a method I have defined as: -(IBAction)next:(id)sender{ ... } I want to call it in -[UIViewController viewDidload] How can I call this method programmatically? ...

Memory Management Question

Hi, i thought i getting the hang of Cocoa memory management, but apperently i have a lot more to learn. Take a look at this class i wrote: Word.h #import <UIKit/UIKit.h> @interface Word : NSObject { NSString *word; NSMutableArray *wordArray; } @property (nonatomic ,retain) NSString *word; @property (nonatomic ,retain) NSMut...

How do i get the effect of a UISwitch as the accessory for a UITableViewCell?

I have a working UITableView filled with some options for my app, and i want to add UISwitches to them just like the Settings app, how do i do this? Thanks :) ...

Animation code doesnt animate?!

I have a view with which I have a button calling the following method. The view hides/shows but without any animation - (void) displayEvent:(id)sender { [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:2.5]; modal.hidden = !modal.hidden; [UIView commitAnimations]; } Any ideas? ...

Convert string to enum

I would like to store my apps skin settings in a json file, how would I go about storing the enum values for colours/styles etc and cast them back from a string. e.g how do I store MKPinAnnotationColorRed or UITableViewStyleGrouped If its just a matter of storing the integer equivilent Im fine with that rather than actually storing the...

what class or viewController is that?

Hi, sorry for this question, but i dont know where to search for it, or how to google it, because i dont have any idea how to search it. with what class/viewController/API is such a "popup" built? thanks for help :) ...

No events such as 'Editing did Change' for a NSTextField?

When I developed for the iPhone I had multiple events on touch that could be true for a button. (e.g. Editing did Change, Editing did End …) Now that I develop for Mac OSX I want my application to recognize multiple events in a NSTextField. How to do that? Is there an alternative for the events? Thanks! EDIT: May delegates be the ke...

Is that right if I switch View in this way... (IPhone)

I have a MyAppAppDelegate, it contains a window, and a UITabBarController. @interface MyAppAppDelegate : NSObject <UIApplicationDelegate> { UIWindow *window; IBOutlet UITabBarController *rootController; } @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet UITabBarController *rootCont...

toolbar in all views (global toolbar)

how can i define a toolbar which is available in all nibs? i have 4 button in my toolbar. one of them is for first view(nib1)and 3 of them are for second view(nib2). ...

Is it possible to store multiple objects using object archving?

Okay, of course it is possible, that's no issue. In my code I have multiple objects that I work with, and they need to be data persistent. To do that I've used object encoding and storing them in a data file. Such as: -(NSString *)dataFilePath { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomai...

IPhone programming starter questin with retain/release/object access

Hi there, I'm pretty new in IPhone Development, so maybe you can help me with this problem: I'm having an object "preferences" that holds a single NSString: (All code simplified...) #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @interface Preferences : NSObject { NSString *username; } -(void)loadPreferences; @propert...

Question about retain count on objects in objects added to arrays, Obj-C

Hi everyone, I'm developing an iPhone app and have a question about memory management. Let's say I have a class called Company with a NSNumber property(nonatomic,retain) called Id. I do this: Company *company = [[Company alloc] initWithId:[NSNumber numberWithInt:1]]; Id should now have a retain count of 1? Then I do: NSMutableArray *...

NSDate from NSString

I've read the DateFormatting guide and I'm still not able to get a working formatter. NSString *string = @"0901Z 12/17/09"; //This is a sample date. The Z stands for GMT timezone //The 0901 is 09h 01m on a 24 hour clock not 12. //As long as I can get the hours/min & date from the string I can deal with the time zone later NSDateForma...

Failing to read array data from a plist - (null) ejected.

Hey! I am currently trying to get data out of a plist. It basically looks like that: plist called 'woerter' -> Root key of type Dictionary -> woerter key of type Array -> various Items of type String with string Values When I now try to read a random string from it, I only get a (null) expression NSString * path =...

How to create a mail on Mail.app (Mac) with an image resource in the middle of the mail.

Hi, I'd like to create a mail (on a Mac with Mac OS X 10.5 and up) that has some text, then an image, then some more text, maybe another image, and maybe some more text... I understand that with the Scripting Bridge, I can add attachments to eMails, but they're always at the end of the Mail. Any idea how to get started here? Maybe use...