ios,objective-c,ios7,uicollectionview,didreceivememorywarningRelated issues-Collection of common programming errors


  • Eran
    ios phonegap push-notification apple-push-notifications
    Similar question here: jQueryMobile, Phonegap and Device Token – iOSThe scenario is, I have this PhoneGap web based application, and the native iOS help me registered the device on APN and I received the device token in my server database.Question 1: How do you associate a registered user (through the UIWebView) to this device token using PhoneGap?What’s in my mind now is to write a custom plugin and pass the device token along during user registration. Is there any better alternative?Question 2

  • Corey Hart
    javascript ios safari mobile-safari deep-linking
    I am looking for an event on mobile safari that will detect when the page has been hidden due to a redirect. I want to open my app directly if a user has it installed, then attempt facebook if it is installed, and if not then go to the webpage for that id.If ‘myapp’ is installed, then myapp is opened. But the safari tab still gets redirected to facebook.com If ‘myapp’ is not installed, but facebook is, then facebook ios app is opened. But the safari tab still gets redirected to facebook.comI’ve

  • Hubert Wang
    ios iphone facebook acaccount
    I found an weird problem of iOS account setting. When I working on ACAccount renew issue, I found that if users login facebook in device setting after my app in installed, my app will not be able to gain access to facebook account.To be precise, my app will not be shown on the “ALLOW THESE APPS TO USE YOUR ACCOUNT”. Therefore, I’ve done some tests about this issue:(1). Facebook login after the app installed -> not shown(1-1). Remove the app and reinstall -> not shown(2). Facebook re-login after

  • Peter Willemsen
    ios facebook node.js
    I am trying to use Facebook iOS sdk with PassportJS (sever is NodeJS) I sucessfully managed to log in with Facebook on my iOS app. The next thing I do is hand over the access token to the server and verify from there. Unfortunately it does not work at all.The weird part is that for my website it works fine. I just use the callback url to post the token to the server.So in code what happens after facebook login (which works)/** Callback for session changes.*/ – (void)sessionStateChanged:(FBSessio

  • syedfa
    ios nsurlconnection nsmutableurlrequest nsmutabledata
    I am successfully connecting to a .NET web service from iOS and print the response xml document to the console via NSLog. This I am doing via the AFNetworking Library. I am now able to connect to this same web service via NSURLConnection, however, I am having trouble extracting the xml document that is being held inside my NSMutableData object. The AFNetworking library is able to do this automatically which makes things a whole lot easier, but I want to know how to do this using native iOS li

  • Klaus Breyer
    ios xcode facebook phonegap
    want to do the first time something with xcode and phonegap. Because I am doing a lot of facebook apps, I want to build a native iOS app with Facebook Login. Followed the Steps here: https://github.com/davejohnson/phonegap-plugin-facebook-connectGot the problem, that the plugin doesnt show up. I copied it like this in the Plugin Folder of my project: http://i.stack.imgur.com/ueYk0.pngBut it is now displayed in Xcode as yellow folder or files in the project structure. Think that it is logical, th

  • genpfault
    ios opengl-es opengl-es-2.0
    I use such code to setup my framebuffer:glGenRenderbuffers(1, &colorBuffer_) ;glBindRenderbuffer(GL_RENDERBUFFER, colorBuffer_);if (!colorBuffer_) {NSLog(@”glGenRenderbuffers() failed”);break; }[self.context renderbufferStorage:GL_RENDERBUFFER fromDrawable:drawable_]; glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &width_); glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &height_);glGenFramebuffers(1, &fbo);glBindFramebuffer(GL_FRAMEBUF

  • Travis Russi
    javascript ios iphone facebook trigger.io
    tl;dr;Issue 1: iOS simulator would hang when trying to facebook.authorize. Safari would open with the facebook mobile URL, but the page would not render.Solution 1: Mis-spelled the permission (publish_actions). Make sure the permissions and audience are spelled properly.Issue 2: iOS simulator (7.0.3) would complete the facebook.authorize process, but the same code on my iPhone 5 (7.0.4) would always return ‘Login failed’. Here’s a screencast of the issue: http://youtu.be/yQiYMFH5y3USolution 2

  • cao lei
    ios facebook login
    I am using FB ios SDK v3.5 for my app. For log in part, I don’t use FBLoginView to log in, instead, I use a UIButton and invoke [FBSession openActiveSessionWithReadPermission] in the handler of that UIButton. In FB SDK v3.2.1, I use the following code to handle different log in scenarios, it works fine: self.useAccountAllowed = true;ACAccountStore *accountStore;ACAccountType *accountTypeFB;if ((accountStore = [[ACAccountStore alloc] init]) &&(accountTypeFB = [accountStore accountTypeWith

  • Bekenn
    ios xcode air static-libraries clang
    After several hours of experimentation, I’ve managed to reduce the problem to the following example (C++):extern “C” void foo();struct test {~test() { } };void doTest() {test t; // 1foo(); // 2 }This is being compiled for iOS devices in XCode 4.2, using the provided Clang compiler (Apple LLVM compiler 3.0) and the iOS 5.0 SDK. The project is configured as a Cocoa Touch Static Library, and “Enable Linking With Shared Libraries” is set to No because I’m building an AIR native extension. The fun

  • bradorego
    objective-c osx quartz-composer
    I’m trying to build something that will only fire a command once per keyboard input (as opposed to every frame like QC does natively). In order to do so, I’m trying to listen in on the keyboard inputs (via Freeboard) and compare the current input versus a previous version.What seems to be happening is the previous version is getting wiped every time the patch executes, so my conditional to compare strings is failing every time. Here’s some code to make it a bit clearer:- (BOOL)execute:(id <QC

  • HurkNburkS
    objective-c ios cocoa-touch nsarray
    I have a NSObject class in which I am sending a NSDictionary object too, the class object then sets all the entries in the NSDictionary to their native types that are variables in the NSObject class.I would then like to pass this NSObject class into its own NSMutableArray however my app is crashing when this happens.below is the code calling the NSObject Class and then trying to set it into a NSMutableArray.NSArray *filteredArray = parsedDataArrayOfDictionaries; //dictionary entries are currentl

  • dream1
    objective-c xcode phonegap sencha-touch-2 phonegap-plugins
    I need some Help regarding Phonegap plugins: First , i have a JS File which invoke the native code using the phonegap.exec() containing the result handler function, error handler function , a reference to the native class’s name and native function name as well as an array of parameters . My question is : if it is possible to invoke the function (native method) with given specified parameters? That means : in my phonegap plugin file (.h & .m) 1- can i specify the arguments and their Types (

  • Matthew Hubble
    c++ objective-c osx qt clang
    I have an application where I need to respond to some Mac OS X specific events. I am using Qt 5.1, and from the docs, I read I should derive QAbstractNativeEventFilter, and then call installNativeEventFilter on my QCoreApplication instance. This works fine, and I can see that the nativeEventFilter function is being called on my derived type.However, the docs says:bool QAbstractNativeEventFilter::nativeEventFilter(const QByteArray & eventType, void * message, long * result) [pure virtual] Thi

  • abentotoro
    ios objective-c sqlite memory-leaks leak
    Thanks a lot to @Hot Licks’s help, He points out what’s wrong with my sqlite3’s codes. I modify the codes and the live bytes increasing by sqlite3 are gone.For other new ios developers may also face this problem, I leave the original questions in the latter part. My new question is: there still are some increasing live bytes between every generation in instruments, but it seems that all the objects are made of ios SDK’s codes, not my codes. So should I leave the increasing alone, and don’t need

  • NS114
    javascript objective-c html5 phonegap phonegap-plugins
    I’ve read Cordova’s tutorials, but I’m not sure they’ve given me enough information.EDITED TO SHOW UPDATED CODE:Let me show you my code:From the config.xml:<plugin name=”someMethod” value=”MyPluginClass” />Now for the Plugin.h: #import <Cordova/CDV.h>@interface MyPluginClass : CDVPlugin- (void)someMethod:(CDVInvokedUrlCommand*)command;@endNow for the Plugin.m:#import “Plugin.h”@implementation MyPluginClass- (void)someMethod:(CDVInvokedUrlCommand *)command {NSLog(@”YOU ARE READING THI

  • Daniel
    iphone objective-c facebook ios6
    Is it possible to use the built-in iOS 6 Facebook integration to get the user’s basic info (email address, birthday, etc)? All of the documentation/examples I have seen use the iOS 6 integration to simply open an SLComposeViewController.Thank you for your time.

  • GeneralMike
    ios objective-c uisegmentedcontrol
    When a user taps on a UISegmentedControl and changes which segment is selected, I want to perform some validation. If the validation fails, I want to ‘undo’ their selection, and re-select the item that they previously had selected.What’s the easiest way to do this? I think I need something like – (BOOL) segment:(UISegmentedControl *)seg shouldSelectSegmentAtIndex:(NSInteger)newIndex`but I was looking at the Apple Docs, but I didn’t see anything like that – really I didn’t see anything with wil

  • clint
    javascript ios objective-c phonegap cordova
    I am creating an app in IOS with cordova 2.1.0 framework. The database files are copied in /iPhone Simulator/6.0/Applications/782BE659-4CE2-4A10-941D-32DE404483E6/Library/Caches folder. I have the following code in index.html:dbName = ‘Database’; gAppConfig.dbMessage = ‘Message Demo’; db = window.openDatabase(dbName, “1.0”, gAppConfig.dbMessage, 200000);db.transaction(querySelectConfig, errorQuery);//Get Messages from the DB function querySelectConfig(tx) {alert(‘select config’)tx.executeSql(‘S

  • krtrego
    c# objective-c monotouch xamarin
    Note: this isn’t an app for the App Store, so using private API’s isn’t a concern to me.I’ve been trying to toggle Airplane mode off and back on using Xamarin/Monotouch based off this SO question: How to turn on/off airplane mode in IOS 5.1 using private APII’m having a hard time getting this code to run in monotouch – first thing I tried was to create a native objective C library using a monotouch binding project.The AppSupport framework is used so my linkwith file is as follows:[assembly: Link

  • ChandreshKanetiya
    objective-c facebook-graph-api ios7
    I have use Facebook SDK Framework for post message on Facebook.I have used native facebook dialog for post message.NSString *msg = @”Sample message for posting…”; BOOL displayedNativeDialog = [FBDialogs presentOSIntegratedShareDialogModallyFrom:self initialText:msg images:nil urls:nil handler:^(FBOSIntegratedShareDialogResult result, NSError *error){if (!error){NSLog(@”result=%u”,result);if (result == 0) {UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@”Successfully posted” message:@”

  • Tim
    ios safari ios7 mobile-safari custom-url
    I’m seeing what appears to be a bug with the way that map links (and apparently all custom URLs) are handled in iOS7. I’d like to know if anyone else is seeing it.Steps to reproduce:Go to Safari Type “maps.apple.com/?q=34.12345,-118.12345” in the address bar Select All -> Copy the text for further testing. Click “Go”One of two things will happen:A. You’ll be immediately taken to the Apple Maps app and the lat/lon will display with a pin. or B. You’ll receive a dialog asking if you’d like to open

  • Neil MCCABE
    ios sqlite ios7
    I’ve got a problem with an update of an SQLite database in iOS7. I think it might be as a result of the lack of a wal file on the new db version, but I might be wrong, as the error is the same when I load i=either the ios6.1 or the iOS 7.0 simulator. I have the simulator loading a local file, using the following code:NSString *dbPath = [[NSBundle mainBundle] pathForResource:@”NLancs” ofType:@”sqlite”];NSURL *storeURL = [NSURL fileURLWithPath:dbPath];// set up for iphone with SQL database in loca

  • Emracool
    iphone ios ios7 uistoryboardsegue
    I declared the two different push segue in the myview1 to display the myview2. Two different push segue is called from two different button actions. Its showing the myview2.In myview2 I am poping the navigationcontroller back to the myview1 in button action. I am getting error in ios7 but in the previous version of iOS its working:nested push animation can result in corrupted navigation barFinishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupte

  • Yuva
    ios objective-c ipad ios6 ios7
    In my iOS Application i’m presenting viewController from UISplitViewController and it’s works fine so far in iOS 6.0 SDK, but now i have updated Xcode 5.0 and iOS 7.0 SDK and now using the same code results in unexpected behavior and viewController position has been changed after it’s presented.Below is the code which i used to present viewController from UISplitViewController when tapping in UITableView -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

  • Fábio Oliveira
    ios objective-c ios7 uistoryboardsegue
    I just encountered a problem with an app I bug-tested. I was banging my head to the wall to understand why I got this error:2013-11-25 09:02:55.687[186:60b] nested push animation can result in corrupted navigation bar 2013-11-25 09:02:56.055[186:60b] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted. 2013-11-25 09:02:57.666[186:60b] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘Can’t add self as s

  • patschiboy
    objective-c annotations ios7 mkmapview
    We’ve seen an unexpected behaviour in one of our apps – one one screen we’re showing annotations on a map view and the user can change the annotations on display by clicking a button.When we rebuild the app with iOS7 the screen would freeze regularly, i.e. no more user input was possible on the MKMapView once the code below had been called several times (with different sets of annotations) – the view is embedded in both a tab bar and a nav controller and all of their UI elements still worked, bu

  • Brad Robinson
    ios xcode ios7
    What exactly does iOS 7 use to determine whether the application should be displayed with the traditional iOS 6 style UI (aka iOS6 compatibility mode), or the newer iOS 7 UI?If I build our app in Xcode 5, with base SDK set to 7 I get the iOS 7 UI as expected If I build our app in Xcode 5, with base SDK set to 6 I still get the iOS 7 UI (unexpected, happens on real device and simulator) If I build in Xcode 4.x, I get the older UI as expectedIn all cases, the deployment target is set to 5.Since ou

  • Nastya Gorban
    iphone objective-c blur ios7
    I’m trying to make a controller that will be similar to Control Center in iOS7. From WWDC session #226 I’ve learnt how to get blurred image with different effects UIGraphicsBeginImageContextWithOptions(image.size, NULL, 0);[view drawViewHierarchyInRect:rect];UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();UIGraphicsEndImageContext();lightImage = [newImage applyLightEffect];So, in other words, we just capture some image (make screenshot), perform blur effect and use this blurred i

  • congliu
    webview ios7 scrollbar
    Using Xcode 5, iOS 7.Problems occurs after changing the frame of the web view from (0, 45, 320, 568 – 20 – 45 – 49) to (0, 0, 320, 568 – 20) or change it back, its superview is its container with a frame (0, 20, 320, 548) to the rootViewController of application window.When changing web view’s frame back to (0, 45, 320, 568 – 20 – 45 – 49) to its container, web view is within 65 to (568 – 49) vertical area, but its scroll bar is scrolling from 65 to around middle of the web view.

  • Kellan Hilscher
    ios xcode uicollectionview
    I am having an issue adding labels to individual cells in a UICollectionView. Using the code shown bellow, the label is added only to the first cell in the collection and none of the others. However, if I change cell.contentView in the third to last line to collectionView, the labels are all added to the right locations, which means I’m dealing with at least the right frame, but I need the labels to be added to the cells themselves.- (UICollectionViewCell *)collectionView:(UICollectionView *)col

  • danh
    iphone ios uiscrollview uicollectionview
    My collection view begins life short, at the bottom of it’s view controller’s view. When the user scrolls up a little bit, I’d like the collection to fill the view. I’d like it to shrink again when the user pulls down into the bounce area.Here’s the code that I’d like to make work (and I think should work):- (void)scrollViewDidScroll:(UIScrollView *)scrollView {if (scrollView == self.collectionView) {CGFloat offsetY = self.collectionView.contentOffset.y;if (offsetY > 20.0) {[self setCollect

  • Zaakk
    objective-c ios uiwebview uicollectionview uicollectionviewcell
    Please help me, how can I save state of UICollectionViewCell. For example: I have cells with UIWebView and when I dequeueReusableCellWithReuseIdentifier:forIndexPath: returned wrong cell, not for this indexPath and after it UIWebView content will reloaded for correct indexPath with twitches. Thanks!- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {NewsCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuse

  • RynoB
    objective-c ios uicollectionview uicollectionviewcell
    I’m currently facing a strange issue with UICollectionViewCell when adding subviews to it but only during certain situations.Here is the scenario:I have a “container” view which conforms to a very specific protocol (ADGControl) with a nested view, typically a UIKit control subclass I.e MyCustomTextField : UITextField for custom controls.The “container” view exposes a property called “innerControlView” which holds a strong reference to the custom control which is what I’m trying to add as a sub v

  • Noor
    ios uicollectionview
    I’m new to IOS Development, I’m designing an interface where I want to use the collection view to place the controls as if in a grid,For this, I’m using a collection as shown in the picture belowHowever, at runtime, this screen is appearing completely black:I was expecting to see the interface I designed as in the first image. But why is the interface appearing completely black?

  • André Dion
    iphone ios objective-c uicollectionview uicollectionviewcell
    I am using MVC pattern in that there is one view controller in which i have UICollectionview, which is loaded with UICollectionViewCell.xib.For example I have ‘A’ as View Controller which get data from Singleton class ‘B’ which in turns calls the respective class at runtime eg:- ‘C’ and ‘D’ class which returns UICollectionViewCell object to ‘A’ view controller. Is this possible and I want that cell to be loaded one by one in UICollectionView?

  • Nitesh
    ios6 uicollectionview uicollectionviewlayout
    I am using UICollectionView using the flow layout. I have made a custom Uicollectionviewcell for the same. But on running the project the console keeps on throwing this error- the behavior of the UICollectionViewFlowLayout is not defined because:the item height must be less that the height of the UICollectionView minus the section insets top and bottom values.I have made sure that the size of the cell is correctHas anyone been able to resolve this issue. Thanks in advance.Regards Nitesh

  • code4j
    ios objective-c ios6 uitextfield uicollectionview
    I downloaded the Collection View example and I replaced the ImageView with textfield. I want to make the textfield as big as the UICollectionViewCell (which is a square shape). But the shape of the textfield didn’t change.- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{static NSString *identifier = @”Cell”;UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPat

  • Hironobu Sano
    ios uicollectionview uicollectionviewcell fragmentpageradapter container-view
    I created containerview. I want to paging in the horizontal mode of UICollectionView it.(Like a FragmentPager of Android) However, error occurs if you put in the ContainerView UICollectionViewCell. (Storyboard: error: Illegal Configuration: Container Views cannot be placed in elements that are repeated at runtime) What do I do now?

  • Ryan Romanchuk
    ios uicollectionview
    It is a best practice to detect if a certain feature’s class exists and degrade user’s features depending on availability. I created UICollectionView in storyboard and a standard tableview to support ios 5.1 users. I then simply check if the user has this feature and segue to the appropriate scene. However, when I now try to compile my code I get a “dyld: Symbol not found: _UICollectionElementKindSectionHeader” This seems very anti-pattern of apple to not allow ios6.0 features in storyboard with

  • Devfly
    iphone ios xcode cocoa-touch didreceivememorywarning
    I don’t know if I’m using viewDidUnload properly. Should I release all stuff I declare in my .h file?Here is how I’m doing it now:@property (strong, nonatomic) Readability *wrapper; @property (strong, nonatomic) ArticleModel *article; @property (strong, nonatomic) Woho *wohoItem; @property (strong, nonatomic) FeedItem *item; @property (unsafe_unretained, nonatomic) IBOutlet UIScrollView *scrollView; @property (strong, nonatomic) NSMutableArray *picturesArray; @property (unsafe_unretained, nonato

  • cheeesus
    objective-c uiviewcontroller garbage-collection monotouch didreceivememorywarning
    As I understand it, we need to hold references to our Cocoa objects when dealing with them in MonoTouch. The reason for this is that the ObjC runtime might still hold references to the objects, and if we have no “MonoTouch references” on them, they could be garbage collected, which results in a EXC_BAD_ACCESS as soon as the ObjC runtime tries to access them.Say, we have two UIViewController subclasses, VC1 and VC2. If the user clicks on a button on VC1, the UI navigates to VC2, and the user can

  • shaik riyaz
    ios objective-c ios7 uicollectionview didreceivememorywarning
    I am using UICollectionView to show all the images available in my library using assets, its displaying all the images but when I scroll up and down many times , I receive a memory issue in the device and after some time it gets crashed saying CRASHED DUE TO MEMORY PRESSURE code used are as followscreates here the collectionview and settings its delegate UICollectionViewFlowLayout *layout=[[UICollectionViewFlowLayout alloc] init]; allPhotosCollectionView=[[UICollectionView alloc]initWithFrame:CG

  • Max MacLeod
    ios uiviewcontroller didreceivememorywarning viewdidunload
    When I’m debugging my iPad app, I found because of low memory, some view controllers’ viewDidUnload got called. But seconds later, their viewDidLoad are called. And then again because of low memory, viewDidUnload, then viewDidLoad again. This is like file system keep swapping files due to low memory.Is it supposed to be like this, or I have done something wrong?Then I wanna release the view controller to get rid of this. But sometimes viewDidUnload is called before dealloc, and then crash due to

  • iCoder4777
    iphone ios-simulator didreceivememorywarning
    I have a tab bar application. Each tab contains navigation controller allowing the user to transition from one view to the other. Each view is being handled by a view controller and each view controller class has -didReceiveMemoryWarning method. Problem: When I use “Hardware > Simulate Memory Warning” option of iPhone Simulator in any model viewcontroller after after that if I want to dismiss that controller using – [self dismissModalViewControllerAnimated:YES]Then, viewDidLoad method is not cal

  • Nick Weaver
    iphone xcode ios memory-leaks didreceivememorywarning
    I am using UIImage picker, Local notification, event calendar, Date Picker , Facebook Sharing, Sounds, Navigation controller , database . My application is crash after some time, the reason is not same, Some times memory is full and some times too manny other receive memory warning. Please guide me how can i generally remove the leaks?

  • mtb
    ios core-data persistence didreceivememorywarning
    I added a managedObjectContext save to my applicationDidReceiveMemoryWarning method in the app delegate. The app seems to crash on some devices when I receive a memory warning now.It seems that the save pushes the app over the memory limit, as it is already low.The reason I have this save in that method is to catch anything that may not have been saved during normal app operation.Can someone tell me if this is bad practice?Thanks.

  • McDJ
    iphone memory-management didreceivememorywarning
    I’m developing an app which uses a UIScrollView to show a list of images based on search criteria. Using a button the user can load more images.When testing on an iPhone 4 the ViewController receives a memory-warning at ~750 images. When testing on an iPod 2nd generation a memory warning is received at ~150 images.My understanding is that when didReceiveMemoryWarning is called, one can free memory by releasing objects but recovery from low memory is not guaranteed.I’ve implemented didReceiveMemo

  • neha
    iphone uiwebview didreceivememorywarning
    In my application I have a tableview which a couple of cells on click of which I launch webview but my application crashes giving me memory warning level 2 even before the webview loads. I have cleared most of the memory leaks. How should I respond to this memory warning? They say that I have to unload the unwanted views. I’m confused here a bit. What should I be unloading here the webview, the tableview?Can anybody please help?Thanx in advance.

  • Daniel
    iphone background didreceivememorywarning
    Is there a way to kill background apps?I have an app that I am working on that records a sound and then plots it out on a scroll view the problem I had with it is it crashes if the recording is too long because it runs out of memory trying to plot it. My fix to this is to monitor the amount of free memory and predict how much memory usage plotting will take and stop the recording just before there is not enough. The problem with that is the more apps I have running in the background the sooner i

Web site is in building