objective-c

How do I break an iPad view up into more manageable chunks?

Hi all, I know I'm probably going to be berated for not properly reading the HIG or some documentation, but after going through several training videos and building a number of small projects on the iPhone, I'm now trying to put stuff together on the iPad and, well, my brain hurts. I understood the idea on the iPhone that one view = on...

Duplicating finger movements Objective C

Hi, I was wondering how I would go about duplicating finger movements with a moving image view object. - ie. you move your finger and a few centimetres away from it, an image moves around the screen, mimicking the movements of the finger I'm sorry that I have absolutely no idea how to do this and I'm sorry if I'm asking for a lot of co...

my mutablearray doesn't work

hello guys sorry for my stupid question (beginner) I got the demo program Accelerometergraph the apple site and would like to use mutablearray in the values of acceleration x. but my mutablearray contains only one object, there being several passage mutablearray routine and should contain the same number of objects that the counter show,...

iPhone Sdk: Is it possible to add an UIImageView as a file!?

Hi everyone, i was just wondering wether it is possible to add an uiimageview as a .m and .h class file because you can just choose a subclass from uiview or uitableviewcell in apple's templates and it than automatically creates the .m and .h files. Is there a way to do the same for an UIImageView or is it possible to somehow "turn" the ...

Remove UISearchBar on tableView click

Hi, I have a UISearchBar which is subviewed by another view when a button is pressed. When it loads, it looks like the following (minus the red scribbles): I would like to have the UISearchBar view be removed from the parent view controller when the tableView (the area with red scribbles) is clicked and is empty (no search has been m...

Table View - Increase Amount of Text to appear in Row - Objective C

Hey, Simply question , how I can display more text in a row in a Table View? See example below, 1) is how it looks at the moment, and 2) is how I want the data to look. Examples of Table View row data 1) TwitterFeed:This is a Working… 2)TwitterFeed:This is a Working feed and this is how i want the text to appear in the row. As you ca...

Trouble with JSON parsing in iPhone App

I've been trying to make this work for some time now, but I think I need someone on the outside to see what I'm doing wrong. In my app, I'm getting a JSON value from a web server, and parsing it into my table view. responseData = [NSData dataWithContentsOfURL: [NSURL URLWithString: @"http://myserver/json"]]; NSString *responseString = [...

Dynamically creating a uiImageView

Hi, I'm still very new to cocoa touch so please excuse any terminology that I may have got wrong. I have a bunch of images in my bundle consecutively named image0.png, image1.png etc... I have a picker in a viewcontroller and an instance variable that keeps track of the current row. When a user clicks a button I want to be able to cre...

iphone-sdk: UIScrollView does not scroll!!

hi, i just can't get my scroll view to actually scroll.. everything displays fine except it just won't scroll..... here's my code: - (void)viewDidLoad { [super viewDidLoad]; UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 600)]; scrollView.contentSize = CGSizeMake(320, 600); scrollView.scrollEnabled...

Coredata: Strategy Pattern Implementation

I'm trying to implement the Strategy pattern using Core Data and Objective C. To simplify, I have, say, a multilingual Text entity, which has several attributes, such as a Date for last saved, and a NSSString for author etc etc. I want to add a reference to a Language entity, which could be one of several subclasses, such as French, Ita...

NSTableView double-clicking/renaming

By default, double-clicking triggers renaming in NSTableView. How can I let double-clicking instead trigger my own custom code (such as opening the double-clicked file)? And also: How can I let the renaming be like in Finder, where you first single click, and then click again and quickly move the mouse pointer away? That is how renamin...

How do you save CoreData with UIPickerView and then load CoreData with UITableView?

I have a multiview application using a tab bar to switch views. One is a pickerview while the other two are a table view and a view with 4 text fields (and one other table view that just contains instructions on how to use the app). I want to use core data to save selected rows in the picker view and also save strings that are entered in...

How to create a random float in Objective-C?

Hi, I'm trying to create a random float between 0.15 and 0.3 in Objective-C. The following code always returns 1: int randn = (random() % 15)+15; float pscale = (float)randn / 100; What am I doing wrong? ...

Which is easier to learn? iPhone development or mac desktop development?

I'd like to start creating a few apps for the mac and iPhone for personal interest, but I'm not sure which is the better place to start. Both seem to have a fair bit in common: objective-c, cocoa, xcode, etc. so I would assume that there are a lot of transferable skills. My question is: which is the easier starting point? Creating a sm...

iphone-sdk: Adding a textfield to UIAlertview does not work in iOS 4??

hi, i am trying to add uitextfield to my alterview. When the user tries to enter text the alterview is supposed to shift up a little bit so the keyboard does not overlap and when pressing the done key the keyboard is supposed to disappear and the alertview should shift back. It all works fine when run it in ios 3.1.2 (and also in 3.2) bu...

mutually referencial .h files?

I'm pretty sure that I'm going to feel really dumb when I remember how to do this, but here it is: I have two classes A and B. A has an object of type B, B has an object of type A. This is not that unusual. The problem is that A.h needs to import B.h and vice versa. However, one of them has to happen first, and when it does, the use of ...

objective C and python - pyobjc

Is it possible for an objective c application to run python files and read their data, ect? If so, can someone post code? or lead me in the right direction? Thanks, Elijah ...

Passing a nil object to a function

Hey guys, I was wondering if objective C does any check to see if a pointer to an object is nil before calling the function. For example, say I have a myObject* ptr; and initialize ptr = nil; and call [self myFunction:ptr]; where myFunction is my own function and does no check to see if the object is nil. I heard somewhere th...

Unset a UIView's animation transition

I use the following code to animate a flip transition on a view: [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:1.0]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES]; [self.view addSubview:anotherViewController.view]; [UIView commitAnimations]; However, when I...

SQLite to NSMutableArray object

Hello all, I'm new to Objectiv-C and i try to get my database SQLite to work, but i get sommene trobble i hobe i can get sommen help here. That i will have my code to doe its bind all "region_title" to tableview, and "region_id" to the id like "html" when you use "options" i have try to search about it but i can't find help to my prob...