i have this code and on the second line it gives me an error that says invalid initialzer
this is the code:
-(void)setPlayerPosition:(CGPoint)position {
CGPoint tileCoord = [self tileCoordForPosition:position];
int tileGid = [_meta tileGIDAt:tileCoord];
if (tileGid) {
NSDictionary *properties = [_tileMap propertiesForGID:tileGid];
...
Hello guys!
Is there a way to remove the "userMessagePrompt" ?
I paste my code to publish a feed:
FBStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease];
dialog.delegate = self;
dialog.userMessagePrompt = @"";
dialog.attachment = [NSString stringWithFormat:@"{\"name\":\"%@ AppName!\","
"\"href\":\"lin...
this is my code and i want use this object to show loading progress,what should i do?
// view.h
#import <Cocoa/Cocoa.h>
#import<WebKit/WebKit.h>
@interface view : NSObject {
IBOutlet WebView* webview;
}
-(IBAction) google:(id) sender;
@end
//view.m
#import "view.h"
@implementation view
-(IBAction) google:(id) sender
{...
Hi,
I use the following code to add cocos2d scene to a viewcontroller
- (void)viewDidLoad {
self.view = [[UIView alloc] initWithFrame:CGRectMake(0,0,320,480)];
if( ! [CCDirector setDirectorType:CCDirectorTypeDisplayLink] )
[CCDirector setDirectorType:CCDirectorTypeDefault];
[[CCDirector sharedDirector] setPixelFor...
I have a Level class, witch contains another Class LevelPoints for some attributes, how can I archive the instance of Level by using
[projectDictionary setObject:level forKey:@"testlevel"];
[NSKeyedArchiver archiveRootObject:projectDictionary toFile:@"somewhere"];
I can not get the _levelPoints variable with values out of the [NSKeye...
I have the ISOCountryCode avaliable and now i want to derive the currencyCode of this country from the ISOCountryCode. How can i achieve that?
NSString *countryCode = < get from someother view>;
NSString *currencyCode = ?;
I receive this country code from some other view on runtime?
...
My coding contains a memory leak, and somehow I can't find the leak.
Leaks points me in the direction of the way I create "ReportDetailItems"
e.g. areaContainer = [[[ReportDetailItem alloc] init] autorelease];
I've been looking at this for hours and I am at a total loss, the objects reported leaking are "ReportDetailItem", and the NSM...
I'm trying to understand how these two are connected. Every time you make a UIViewController does it also automatically come with its own UIView?
Also are these from Cocoa or Objective-C?
...
Hi there,
I'm turning around and around with the following code giving me a memroy leak in the pics object apparently linke to the object imageName.
for (int i = 0;i<[potatoesIndexesArray count];i++){
int imageNumber = [[potatoesIndexesArray objectAtIndex:i]intValue];
NSString *imageName = [[NSString alloc] initWithFormat:@"...
In C++ community, "Effective C++" is very famous for its concise, in-depth and practical style. For Objective-C, most of the books in the market is primer introduction to the language. Is there a book for Objective-C like "Effective C++" for C++?
BTW, I found this document is very valuable for a programmer from C++ to Objective-C: http:...
Hi all,
I'm working on an iPhone app that (among other things) has a detail view for records with lots of attributes and lots of related records. Rather than having one really long scroll view or table view, I am thinking it might be easiest to break the detail view into several separate views (some UIViews, some UITableViews, etc) tha...
Hello, guys.
I have an app that if it is quit in a certain view, I want to restore this view exactly where the user left.
My applicationDidFinishLaunching is very simple at the moment:
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// Override point for customization after app launch
[window addSubvi...
I'm writing a class that uses a JSON API for a website I visit. In my class I use NSURLRequest to fetch the data, but then I need to give the data to the app delegate. I realize NSURLRequest is asynchronous so I can't directly return the data.
So let's say in my class, the delegate calls getUserProfile, the method uses NSURLRequest to g...
I am trying to get the trail name from the selected cell and pass it on to the next view in didSelectRowAtIndexPath. How would I go about this?
http://pastebin.com/bgXNfjie
...
I have a UITableView inside of a View created from a NIB. the table has one section containing 6 rows and 1 footer. when i use:
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
return 80;
}
to return the height of the footer, which is being loaded from the same NIB. the UITableViewCell ...
I have a document-based application but I am not using undo. How do I change the status of my window to be 'dirty' and certain times?
Thanks.
...
Trying to set my out of office on with a new reply message on Exchange 2003....
Here's my code:
NSString *tempbaseurl = @"https://webmail.server.com/exchange/mailbox/";
NSURL *url = [NSURL URLWithString:tempbaseurl];
NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url];
NSString *sMessage = @"I am currently out of the...
i have the following two pieces of code which i think should be identical
int temp = [[[myArray objectAtIndex:iIndex] objectAtIndex:jIndex] state];
if (temp > 0)
{
NSLog(@"TEST: %d",temp);
}
if ([[[myArray objectAtIndex:iIndex] objectAtIndex:jIndex] state] > 0)
{
NSLog(@"TEST: %d",temp);
}
state is just an int in the objects ...
I have two views controlled by a uinavigationcontroller. the first view has a UIWebView and has button that takes the user to the second view. The user can get back to the first view by tapping the back button on the nav bar. however the webview's content is not current. How can I refresh the content in the first view's webview when comi...
I've recently been writing some basic command-line programs (I want to keep my skills sharp over the summer), but printf and scanf have been starting to annoy me. I'm not a wonderful C programmer, and having to get into printf/scanf and their instabilities (or even worse, fgets and their ilk) isn't exactly putting me in a comforting sett...