Hi I am trying to create a table-view programatically using a cocoa lisp bridge called clozure CL. Now I doubt many people are familiar with this package so I will not go into specifics of my code but I am getting some very strange errors when I try to call addSubview to add my tableView to my window. I have initialized it using InitWi...
Hello,
I want create a UIImageView with a button press. I did this with:
- (IBAction) addPicture:(id)sender {
imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0.0, 45.0, 324, 52.0)];
imageView.image = [UIImage imageNamed:@"Picture.png"];
[self.view addSubview:imageView];
}
I "created" this imageView in the .h, beca...
Hey Guys!
I'm stuck!
I am trying to create a custom modal dialog. I would like it to perform similarly to the NSSavePanel using a block as a completion handler.
I've copied only the important snippets I think are needed.
@implementation ModalWindowController
- (void)makeKeyAndOrderFront:(id)sender
modalToWindow...
I'm designing the back-end for an iphone application. I'd like to use Core Data. Is there an ideal transfer format for iphone apps? I'm leaning towards JSON unless there's some custom binary thing. I'm probably using ruby on the backend.
For example, in the Flex/Flash world, you can install a small piece on your server that lets you se...
Hi All
I wonder if anyone could suggest the best way to go from one color to another in a gradual process.
So - I have a text box which I have a text limit on. I'd like to have the text start at white, but be red by the time it gets to the max text limit.
Is there an easy way to do this? I'm unsure really where to start...
...
Hello,
The user can create a unlimited number of UIImageViews with a button press with this code:
- (IBAction) addPicture:(id)sender {
imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0.0, 45.0, 324, 52.0)];
imageView.tag = a;
imageView.image = [UIImage imageNamed:@"Picture.png"];
a = a + 1;
[self.view addS...
Hello,
I created a subclass (called MyPicture) of the UIImageView with this methodes:
- (id)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
self.userInteractionEnabled = YES;
}
return self;
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
NSLog(@"-- I AM TOUCHED --");
}...
I am finding some difficulty in accessing mutable dictionary keys and values in Objective-C.
Suppose I have this:
NSMutableDictionary *xyz=[[NSMutableDictionary alloc] init];
I can set keys and values. Now, I just want to access each key and value, but I don't know the number of keys set.
In PHP it is very easy, something as follows...
Hi,
I have released and updated a few apps now, but this is still not very clear.
The app name as it appears on the app store is set from iTunes connect. Where do you set the name of the app as it appears on the phone once it is installed?
I have tried and succeeded in setting it in 'Product Name', but when Product Name has a space in...
So assume I have a class that has an init method that does something like... grabs some data off the net in xml format and parses it to initialize some of its properties. My concern is how should I handle the case where the network is down or the xml data my object receives is bad?
Normally in C i would use return values to indicate an...
Hello,
What is the best way to see if a song exists in the iPod library? I am currently doing the following:
MPMediaQuery *query = [[MPMediaQuery alloc] init];
[query addFilterPredicate: [MPMediaPropertyPredicate
predicateWithValue: artist
forProperty: MPMediaItemPropertyArt...
I create random numbers using the following code and store them in an array.
NSMutableSet *aSet = [NSMutableSet setWithCapacity:6];
while([aSet count]<=6){
int Randnum = arc4random() % 12;
[aSet addObject:[NSNumber numberWithInt:Randnum]];
}
NSArray *arrayOfUniqueRandomNumbers = [aSet allObjects];
Now, I need to read the ...
Hi everyone!
I'm just a beginner at Objective-C and its syntax is just knocking me out of my mind.
I'm 'trying' to work on iphone 3.0.
Up till know I have learned that:
there is .h file which contains the
declaration for every class; like we
have in C++ where we can declare the
name of the variables/data_fields
and later define the...
I have the following instance method (adapted from Listing 3-6 of the Event Handling section in the iPhone Application Programming Guide):
- (CGPoint)originOfTouch:(UITouch *)touch
{
CGPoint *touchOriginPoint = (CGPoint *)CFDictionaryGetValue(touchOriginPoints, touch);
if (touchOriginPoint == NULL)
{
touchOriginPoint...
Hi!
I am making an app for preschoolers with several mini-games. One of them involves finding "what is wrong" in the picture. For example if they press the kid playing in the street, a pling sounds, the child is moved out the street, and a label is updated to "1/5 errors found". If they find them all, they move on to a new viewcontrolle...
-(void) addFractions: (Fraction*) f
{
numerator = numerator * f.denominator
+ denominator *f.numerator;
denominator = denominator *f.denominator;
}
//This is objective c-2.0
// this is the .h file for the .m above
-(void) addFractions : (Fraction*) f;
Don’t forget that you can refer to the Fraction that is the recei...
Hi everyone
I have a question in game development. I am building a game for iPhone. At the game play, there is a damage bar, that displays what the player has damage the enemies. The technique I use is using 2 pictures.
One is a damage bar which is fill with full damage, and one is jus a black bar but same size with the damage bar. It i...
In My application we add InAppPurchase application with MKStoreObserver.h and .m file and MKStoreManager.h and .m file in my app. we want to test my this as transaction is done or not how to do this.
...
Hi everybody,
I am trying to use the push notification service provided by apple but I am not able to get the device token required for pushing the notification. I am using the following code for retrieving the device token
- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)devToken {
co...
I want to set the annotation to the all place of search result of google map. but i am getting the only single annotation at single point of search result.
- (IBAction) showAddress {
[addressField resignFirstResponder];
MKCoordinateRegion region;
MKCoordinateSpan span;
span.latitudeDelta=1;
span.longitudeDelta=1;
CLLoc...