iphone,objective-c,chartboostRelated issues-Collection of common programming errors
atu0830
iphone asyncsocket
AsyncUdpSocket *socket=[[AsyncUdpSocket alloc]initWithDelegate:self];NSTimeInterval timeout=500; NSString *request=@”quick_stat”; NSData *data=[NSData dataWithData:[request dataUsingEncoding:NSASCIIStringEncoding] ]; UInt16 port=8081; [socket sendData :data toHost:@”255.255.255.255″ port:port withTimeout:timeout tag:1]; NSLog(@”begin scan”);if host address is “255.255.255.255”, or “192.168.1.255”, will get 2011-03-30 19:40:34.547 voco[38177:207] AsyncUdpSocket 0x629bf30 received unexpected CFS
Parth Bhatt
iphone objective-c xcode wsdl xmlhttprequest
In my app i am using WSDl webservice.And try to call webservice method. In that request send successfuly and also get response.But when i fetch that response using following method:// Called when the connection has finished loading. – (void)connectionDidFinishLoading:(NSURLConnection *)connection {NSError* error;if(self.logging == YES) {NSString* response = [[NSString alloc] initWithData: self.receivedData encoding: NSUTF8StringEncoding];NSLog(@”response=%@”, response);[response release];}It giv
Vishal
iphone ios objective-c xcode
I got a ViewController where I add many childs on like this:[self addChildViewController:myViewController];After this I want to remove some of the childs dependent on where I am in my program to free up memory. So I was thinking of something like this:[self.childViewControllers objectAtIndex:1]and then use removeFromParentViewController. But how can I provide this code on objectAtIndex? I also tried: [self.childViewControllers objectAtIndex:1] = nil;But this doesn’t work, I get the error that th
nschum
iphone ios4 sdk ios-ui-automation
I am new to iPhone Automation, and UIAutomation framework introduced by iOS4. Recently I am using UIAutomation to automate testing app on iPhone Simulator via instruments but it gives me an error like “Unexpected error in -[UIATarget_0x5a20d20 frontMostApp], /SourceCache/UIAutomation_Sim/UIAutomation-37/Framework/UIATargetElements.m line 437″I have also tried it by running app on the iPhone 3G device after updating it with iOS4. But the instrument shows me the warning “Automation is not supporte
Thermometer
ios iphone objective-c uiwebview ios7
The Problem:I have a UIWebView between my UINavigationBar and UITabBar. On iOS 7, when the app enters background and comes back again, it seems as if the contentSize property of the UIWebView changes so that there is a white block above it. After monitoring the contentSize of the UIWebView, when the application enters foreground (I check it by observing the UIApplicationDidBecomeActiveNotification), it has 49 substracted from it’s height. Screenshot (redacted sensitive info):My Settings: I am us
Kara
ios iphone google-maps-api-3 google-places-api
I am trying to fetch the data from google place API.I have tried the url with one type,and getting the result.But when I give pipes to seperate the types I am getting Json Error.But I am getting the json array when I run this url on a browserWhat may be the issue ?? NSString *string = [NSString stringWithFormat:@”https://maps.googleapis.com/maps/api/place/search/json?location=10.76894,70.25412&rankby=distance&types=restaurant|park|hospital|school|bar&sensor=false&key=myKey”];NSUR
SpaceBeers
iphone mapkit ios6 ios6-maps
My understanding was there was no problems moving to iOS 6 maps. But for some reason, the Detail Disclosure Button is now MISSING in my map App. Is there a way to get this back. Wow, totally unexpected. This has been working for years, so all delegates are fine.#pragma mark MKMapViewDelegate – (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation {MKPinAnnotationView *pin = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifi
albertamg
iphone ios uiimageview
I need to put an image to the bottom of screen, so I used UIImageView and tried two ways to specify its position:someImageView.frame=CGRectMake(x, y, a, b); [someImageView initWithFrame:CGRectMake(x, y, a, b)];But it shows up at the top covering the navigation bar. What did I do wrong? What would you suggest to do?Thank you in advance.
iDev
iphone objective-c ios nsdate
NSDate *date = [NSDate date]; NSDateFormatter *dateFormat = [[NSDateFormatter alloc]init]; [dateFormat setDateFormat:@”MM/dd/yyyy”]; NSLog([@”today is ” stringByAppendingString:[dateFormat stringFromDate:date]]); NSLog([@”firstBirthdayDate is ” stringByAppendingString:[dateFormat stringFromDate:firstBirthdayDate]]); NSLog([@”secondBirthdayDate is ” stringByAppendingString:[dateFormat stringFromDate:secondBirthdayDate]]); if ([firstBirthdayDate isEqualToDate:secondBirthdayDate])NSLog(@”First date
Prasad Devadiga
iphone json ios
I am trying to send the data to server and get the response. Data is reaching server but I am not getting any response. The value of response data is nil bcd of which it’s throwing an exception,-JSONValue failed. Error trace is: ( “Error Domain=org.brautaset.JSON.ErrorDomain Code=11 \”Unexpected end of string\” UserInfo=0x4e2dd70 {NSLocalizedDescription=Unexpected end of string}”Can anyone pls help me….My code:NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithStr
Paul Renton
objective-c data-structures cocos2d
Some Context: In my destructible terrain library for Cocos2D, one of the features is collapsable terrain. In order to collapse efficiently, I store the columns whose pixels have been altered in a NSMutableSet which contains NSNumbers which contain integers. I am using this data structure because I don’t want to iterate over duplicate columns.My first instinct for how to loop through the NSMutableSet was to use a ‘for in’ loop.for (NSNumber * col in [alteredColumns allObjects]) { // Works // for
rufo
objective-c restkit
I am wondering what the “default” response from a “DELETE /api/myEntity/1” request is RestKit expecting. My current web service returns OK (200) status code with empty body. Meaning that the object was successfully deleted. RestKit triggers the onDidFailWithError method, and also logs some messages to the debug output:restkit.network:RKObjectLoader.m:300 Unable to find parser for MIME Type ‘text/plain’ restkit.network:RKObjectLoader.m:329 Encountered unexpected response with status code: 200 (MI
Parth Bhatt
iphone objective-c xcode wsdl xmlhttprequest
In my app i am using WSDl webservice.And try to call webservice method. In that request send successfuly and also get response.But when i fetch that response using following method:// Called when the connection has finished loading. – (void)connectionDidFinishLoading:(NSURLConnection *)connection {NSError* error;if(self.logging == YES) {NSString* response = [[NSString alloc] initWithData: self.receivedData encoding: NSUTF8StringEncoding];NSLog(@”response=%@”, response);[response release];}It giv
kschins
objective-c ios
What is the highest int that NSNumber allows? I’ve seen the answer elsewhere on these forums hence why I’m deeply confused here.int miles = 35000; vehicle.mileage = [NSNumber numberWithInt:miles]; NSLog(@”int value = %d”, miles); NSLog(@”mileage = %@”, vehicle.mileage);The output is:int value = 35000 mileage = -30536I must be missing some terrible easy here, but can someone explain to me why this is not working correctly?UPDATE: After looking further, vehicle.mileage is getting set correctly to
stosha
ios objective-c
I created a new project as Single View Application. Added code in view controller for converting a view coordinate to window coordinate:- (void) dumpFrame {CGRect bounds = self.view.bounds;// UIView* rootView = [UIApplication sharedApplication].keyWindow.rootViewController.view;// I tried rootView instead of nil and self.view.superview instead of self.view but got {0,0} coordinateCGPoint newCoord = [self.view convertPoint: bounds.origintoView: nil];bounds.origin.x = newCoord.x;bounds.origin.y =
Vishal
iphone ios objective-c xcode
I got a ViewController where I add many childs on like this:[self addChildViewController:myViewController];After this I want to remove some of the childs dependent on where I am in my program to free up memory. So I was thinking of something like this:[self.childViewControllers objectAtIndex:1]and then use removeFromParentViewController. But how can I provide this code on objectAtIndex? I also tried: [self.childViewControllers objectAtIndex:1] = nil;But this doesn’t work, I get the error that th
phyrrus9
ios objective-c
say my goal is that both users of iOS5 and iOS6 should be able to use my application.What shall I do in order to achieve this?For example, what I know is, I could set Base SDK to 6.1, and Deployment target to 5.0. Then, in the code I should ensure I don’t use iOS6 specific methods (or use code branching with respondsToSelector if I use iOS6 specific methods).My question is: should I pay attention to anything else, in order to achieve the goal I mentioned above?Thank you.
Zhen
objective-c ios view uiimagepickercontroller unload
I have 2 tabs, one that contains the imagepicker controller, and another that contains a UItableView as a subview to a uiview controller.I realise that when I call the imagepicker controller (SourceTypeCamera), my page in the other tab is being unloaded (‘view didUnload’ method) is triggered.Is this a normal behaviour I should expect? (that other tab’s views get unloaded) Or is it due to some memory issue when using the camera which I should take care off?
Andy Bowskill
c objective-c char boolean typedef
Something that has piqued my interest is Objective-C’s BOOL type definition. Why is it defined as a signed char (which could cause unexpected behaviour if a value greater than 1 byte in length is assigned to it) rather than as an int, as C does (much less margin for error: a zero value is false, a non-zero value is true)?The only reason I can think of is the Objective-C designers micro-optimising storage because the char will use less memory than the int. Please can someone enlighten me?
Gopi
objective-c c sockets
I’m facing a problem with write function not working properly if it placed inside a loop with out sleep.what i’m trying to achieve is to transfer files from local machine to a remote FTP server the following code works fine but the write function not transferring the bytes properly it transfer only of the half bytes, it works fine with sleep blocks the loop.struct sockaddr_in {int16_t sin_family;uint16_t sin_port;struct in_addr sin_addr;char sin_zero[8]; };struct in_addr {uint32_t s_addr; };str
user3049013
android andengine chartboost
can anybody tell me how can i configure the Chart boost add platform in an And engine game to show add’s in the game. i have downloaded the chartboost sdk and i am trying to configure the ChartBoost in onCreateEngineOption like -public EngineOptions onCreateEngineOptions(){camera = new BoundCamera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED, new FillResolutionPolicy(), this.camera);engineOptions.getAudioOptions().setN
Guru
iphone objective-c chartboost
Here is code:Chartboost *cb = [Chartboost sharedChartboost]; cb.delegate = self; cb.appId = CHARTBOOST_APPID; cb.appSignature = CHARTBOOST_APPSIGNATURE;[cb startSession]; [cb cacheInterstitial];This works fine in iOS6 device but crashes in iOS5.Crash Log:NSInvalidArgumentException Reason: -[__NSCFDictionarysetObject:forKeyedSubscript:]: unrecognized selector sent to instance0x1234sva8How can I solve this problem? Already I made AdSupport.framework optional.
Web site is in building