How can I add an opaque type to a collection in cocoa?
I get a compiler warning for this (obviously, because opaque types are not objects):
CGColorSpaceRef colorSpace;
NSArray *myArray = [NSArray arrayWithObject:colorSpace];
...
I would like to take a stack of images (or potentially an array of URLs to download images) and display them in full screen, one at a time, using user swipes to smoothly animate the next image in the stack, using the iPhone SDK. Apple's Photo.app seems to do this. Additionally, if the image has not been retrieved yet, I'd like to display...
Okay, this is the code:
[lblMessage setText: txtEnter.text];
[lblMessage sizeToFit];
scrollingTextView.contentSize = lblMessage.frame.size;
float width = (lblMessage.frame.size.width) + (480);
[UIView beginAnimations:@"pan" context:nil];
[UIView setAnimationDuration:durationValue];
[UIView setAnimationRepeatCount:5];
scrollingTextView...
Hi,
i am trying to build an iphone app by using cocos2d. but i have used four types of classes
like bellow-
@interface MenuScene : Scene {}
@end
@interface FlipView : UIImageView
{
CGPoint startTouchPosition;
NSString *dirString;
UIImageView *firstPieceView;
UIImageView *secondPieceView;
}
@end
@interface HelloCont...
Hi,
i am new at the area of iphone. i am trying to build an iphone app by using cocos2d. i have used this type of classe like bellow-
@interface MenuScene : Scene {}
@end
@interface FlipView : UIImageView
{
CGPoint startTouchPosition;
NSString *dirString;
UIImageView *firstPieceView;
UIImageView *secondPieceView;
}...
Hello,
i am trying to build an iphone app by using cocos2d. and i would like to set an image to another fixed position from a fixed position by using touch as my wish(speedy, or slowly). i have got some code but it does not work properly.
so freinds it will more helpful to me if i get any solution.
...
i got an object and in that object i start my thread (for loading doing some url loading)
when i have a return of my data i call a selector to perform on the main thread.
works fine if i call it the first time , second time it crashes ( no specific error)
[NSThread detachNewThreadSelector:@selector(doThread:)
toTarget:self
...
I just discovered the NSRect helper functions in NSGeometry.h (i.e. NSMidX, NSMaxX, etc...)
These would have made some repetitive coding much easier. I knew about NSMakeRect, NSMouseInRect, NSOffsetRect and many others but somehow missed the functions that aid in recalculating NSRect geometry.
...
I've heard a few debates in the past over which is more mature: RubyCocoa or Obj-C/Cocoa... but I have felt that the answers jet right over the "newbie" that would truly appreciate an answer.
So the question is: for a total beginner, with little-to-no programming experience, is it easier to learn Ruby and explore Cocoa via the bridge (t...
Are there any shortcuts to (stringByAppendingString:) string concatenation in Objective-C or shortcuts for working with NSString or other objects in general?
e.g. I'd like to make this:
NSString *myString = @"This";
NSString *test = [myString stringByAppendingString:@" is just a test"];
something more like this:
string myString = "T...
What is the best way to generate random numbers using Objective C on the iPhone?
If I use (int)((double) rand() / ((double)(RAND_MAX) + (double) 1) * 5.0) to generate a number from 0 to 4, every time I start the program on the iPhone it generates the same numbers to start off with.
...
Hey there,
Does anyone know the best way to check to see if an optional protocol method has been implemented.
I tried this:
if ([self.delegate respondsToSelector:@selector(optionalProtocolMethod:)] )
where delegate is:
id<MyProtocol> delegate;
However - I get an error saying that the function respondsToSelector is not found in th...
What's wrong with the following code?
-(IBAction)numFieldDoneEditing{
NSPredicate * regexTest = [NSPredicate predicateWithFormat: @"SELF MATCHES '^\\d*\\.\\d{2}$'"];
NSString *text = [[NSString alloc] initWithFormat: @"%@", numberField.text];
if ([regexTest evaluateWithObject: text] == YES) {
//do somet...
Just a quick question from an Objective-C beginner: what does the asterisk in the parenthesis mean in the following sample code? Is it a pointer? Thanks in advance.
#import <Foundation/Foundation.h>
@interface Tire : NSObject
@end
@implementation Tire
- (NSString *) description
{
return (@"I am a tire.");
}
@end
...
Hi,
I have a RootViewController and a SubViewController. I traverse the views in either direction. The RootViewController is a UITableView SubClass. Depending upon the row selected I want to change the title of the subview using self.navigationItem.title = [chunks objectAtIndex:1];
It works when the subview is first time loaded. But whe...
I have a UITextView that i use for typing some text
(i have added it with Interface builder)
i have made the height 3 font lines high (so in my case the frame height is 47) so i can have 3 lines of text
what i want it to do is type until line3 and the go up if i goto line 4
but what it does is whenever i type enter it automatically goe...
hello,
i am a learner at the area of objective c. i am trying to build an iphone app. and here i have used cocos2d. now i would like to use UITableView for showing data from XML file. Now it is my question that , is it possible to use UITableView with cocos2d and is it also possible to retrive data from XML file.
...
I want to know whether I can access the directory where my application is installed.
Also I want to create a sub directory in the same directory to store all the images I capture in my application. I further want to view the images using iPhone's default image viewer. Can this be done?
...
I'm hitting a road block and I'm wondering if the brilliant collective minds here can help. In ObjC CocoaTouch I'm trying to mock an object that takes struct parameters and returns a struct. OCMock is coughing up a hair-ball so I tried wrapping with a Hamcrest matcher. No die. The function/method I'm testing looks something like this:
-...
I have a method that varies by a single method call inside, and I'd like to pass the method/signature of the method that it varies by as an argument... is this possible in Objective C or is that too much to hope for?
...