spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
  Home » IOS » Page 2
How do I exclude an IOS 8 app extension from a build?
I've looked in the info.plist, the build phases and the schemes for the apps and the extension and have found no references to either. Look again? The setting that controls whether an app includes an extension is in the build phases for the app. By default it's called "Embed App Extensions", but you can rename it to whatever you like. Select the extension(s) and click the "-" button at the

Categories : IOS

EXC_BAD_ACCESS when capturing a GPU frame
This was indeed due to some GL state being left over, specifically a glVertexAttribPointer. The reason I didn't catch it was because it was an order of operations problem directly within the 3d engine itself: child objects were being iterated (and rendered) before some state was cleared up. (Apologies, this was a tediously project-specific issue)

Categories : IOS

iOS 8 - Map keeps reanimating back to user location
Your code says: mapView.showsUserLocation = YES; That means that map view is tracking the user location. It wants to keep showing it. If you want the map view to stop doing that, stop tracking the user location. Typically, you'll adjust the MKUserTrackingMode. The simplest way to do that, and to let the user do it, is to provide an MKUserTrackingBarButtonItem. Also, make sure that you are n

Categories : IOS

Constantly refreshing background image of UIImageView IOS
It depends on where the new images are coming from. If they are a cycle of known existing images in your app bundle, just make this an animated image view (or an animated image) and the cycle will happen automatically. If you need to run code e.g. to get out to the network periodically, then just start a repeating NSTimer. It calls you on the main thread, but your main thread code will be very br

Categories : IOS

UINavigationController keeps displaying popped view
Only reason i can think of where this might happen is if you are not doing that in a main thread. If you are doing it after some network call, then do make sure you are going back to main thread. Sometimes, app won't crash if you do UI work on background thread but rather will behave like what you are seeing!

Categories : IOS

Swift closure syntax using Shark Food Mute Switch?
Never used that library, but looking at the documentation linked in your question I notice that silentNotify is a property: @property (nonatomic,copy) SharkfoodMuteSwitchDetectorBlock silentNotify; containing the block, so the error stating that a BOOL is expected makes sense. Instead with your code you are probably trying to call this method: -(void)setSilentNotify:(SharkfoodMuteSwitchDetect

Categories : IOS

MagicalRecord 3.0 not saving. No objects for the second build
A couple of thoughts: Looking at the code for MagicalRecord 3.0, MR_context returns a NSPrivateQueueConcurrencyType. Using MR_createEntity appears to use a different, main queue context. Try creating your entity with MR_createEntityInContext: and passing in MR_context. Also, without knowing when you are calling each of the three methods, try using MR_saveToPersistentStoreAndWaitWithError:. EDI

Categories : IOS

iOS / Swift Can't add gesture to child class
Are you are calling this class in the following way (if not ignore my answer)? // wrong implementation func myFunc() { var a = Alert() a.ShowAlert("Message", view: view) } The previous code is wrong (and causes BAD_ACCESS) because a does not exists anymore after the function finished. So when the gesture is fired, it acts on nothing and crashes. Solution: var a = Alert() // a property

Categories : IOS

iOS: Is there currently a way to prevent two view controllers being pushed or popped at the same time?
Updated answer: I prefer this solution by nonamelive on Github to what I originally posted: https://gist.github.com/nonamelive/9334458. By subclassing the UINavigationController and taking advantage of the UINavigationControllerDelegate, you can establish when a transition is happening, prevent other transitions from happening during that transition, and do so all within the same class. Here's an

Categories : IOS

Checking if array contains two objects
There is too many arguments, containsObject is for a single object. (You can read its official documentation here) To fix your problem, use the && operator and call containsObject on each object individually. if ([myArray containsObject:@"Object1"] && [myArray containsObject@"Object2"]){ return result; } else { return NO; }

Categories : IOS

How should turning of SCNLight affect background color?
If you set a background color, that is going to be independent of the lighting in the scene, it's just a background color. You could animate it to also be black when you turn of the light if you wanted to. The scene (SCNScene) also has a background material property that you can set the contents of. This material property should be affected by the light in your scene.

Categories : IOS

Why don't my views show up in Storyboards and are greyed out in the left pane?
Just found an answer myself, it was because Size Classes were reset after I moved the project... Greying out views is Xcode's standard behaviour when the views are only set for a specific size class which is currently not selected! I had set the size classes for my UIViewController to Compact - Any, this is what it looks like in proper state: The problem occurs when I change the size class

Categories : IOS

SWIFT convert NSTimeInteval to NSDate
There is a initializer of NSDate that takes NSTimeInterval: init(timeIntervalSinceReferenceDate ti: NSTimeInterval) So just do: var date = NSDate(timeIntervalSinceReferenceDate: 123)

Categories : IOS

BLE scanning is stopped when go to background?
Found out that you must set the service id that you look for in background otherwise it won't work. Anyway the scanning in background is very slowly and can take minutes to detect!! [_centralManager scanForPeripheralsWithServices:@[[CBUUID UUIDWithString:DEVICE_INFO_SERVICE_UUID]]

Categories : IOS

Drawing a Rect on UIView
As @matt hints in comment, the most usual cause of this is that you've not bound your properties or fields to your UI components properly, or else you've tried to run this code before the UIView was loaded. In either case, _areaGame is nil and the addSubview call silently does nothing. Setting a breakpoint on the addSubview line and inspecting _areaGame is the quickest way to verify.

Categories : IOS

HLS playback via local HTTP server on iOS
I was writing an additional echo message back to server in (void)socket:(GCDAsyncSocket *)sock didReadData:(NSData *)data withTag:(long)tag Once I removed it everything started working as expected. Just mentioning this in case some one wants to use the code posted above.

Categories : IOS

Re-Assigning SKScene delegate protocol
Personally, I found your description as well as the code you posted a bit lacking in details as well as being a bit confusing. When providing code you will probably get better/quicker help if you provide more detail. For example, which file does goBackToMenu belong to? How/in what context is [self.mySceneDelegate showFullScreen:self]; called? I would assume that it is from some trigger point

Categories : IOS

Network lost on screen lock unlock
It looks like an iOS bug. Weirdly, but lock screen action affects NSURLSession somehow, so that it stops working and returns NSURLErrorNetworkConnectionLost. So in my app I gave up using shared session. I either use a new session object for every request or (if I need to maintain one session constantly) recreate it every time the screen gets unlocked. And it works. For users of AFNetworking or any

Categories : IOS

Annoying Xcode Error "file not found" #import
I apologize, I had forgotten to add the iOS headers to the git repo for version 1.0.1.i. I was using this cocoapod for a Mac project so I didn't notice. You've probably sorted this out already but in case anyone else runs into the issue, just upgrade to version 1.0.1.j and the iOS headers will be there. Example Podfile: source 'https://github.com/CocoaPods/Specs.git' pod 'OpenSSL-Classic', '1.0

Categories : IOS

CoreData not firing faults
It's hard to answer this kind of question without seeing the actual code. However it appears your fetchResultController's results are being changed during the navigation. A good practice would be, try to execute your fetchRequest and feed it to the fetchResultController in your ViewController's viewWillAppear.

Categories : IOS

iOS:How do you change a view size/origin from another view controller class?
I want to change the size/origin of "View A" from "View B" What's the relationship between the views? If the two views are managed by different view controllers, then they shouldn't talk to each other directly. Generally, a view that might have something to communicate to the rest of the world calls a method on its delegate, which is typically the view controller that manages it. That view co

Categories : IOS

Changing a frame in viewDidLayoutSubviews
If you need to animate something when view will appear and then not touch subviews later, I would suggest the following: Don't change/touch viewDidLayoutSubviews Add logic to move elements outside the screen (to their initial position before animation) in viewWillAppear Add logic to animate elements into their proper position in viewDidAppear UPDATE: If you're using auto-layout (which is very

Categories : IOS

Animate multiple shapes in UIView
You need to move all your drawing code to a subclass of CALayer, and decide parameters which, once varied, will produce the desired animations. Convert these parameters to the layer's properties, and you can animate the layer's properties with CABasicAnimation (or even [UIView animateXXX]). See this SO question for more information. Make sure that you set the layer's rasterizationScale to [UIScr

Categories : IOS

Add NSIntegers ONLY when 2nd NSInteger Changes Value
I would say that you should do this calculation only once at the end of a game. If you need to show the calculation result all the time, you can add a class variable to keep count. And in each run of that code do: count++; if (count == 10) { NSInteger toReport = startIt++; [defaults setInteger:toReport forKey:@"totalScripturesCollected"]; [defaults synchronize]; count = 0; }

Categories : IOS

Facebook SDK, fetching friends
I tested a lot Facebook API this year, and Facebook won't let you see your friends, for security matters, they only let you see the ones registered in the same app. If you are seeing the ones that are not, probably Tinder or whatever app is not using the latest version, v1.0 i guess, that will expire on April 30th, 2015.

Categories : IOS

How to get Storyboard to support dynamically sized cells in UICollectionView?
The cell sizes aren't determined by auto layout, they're set by the itemSize property of the layout object. If you only have one cell type, then you only need one cell in the collection view in IB. When your collection view is loaded, you can set that size in code, based on the width of the collection view. I've done it like this, -(void)viewWillLayoutSubviews { self.layout.itemSize = CGSizeM

Categories : IOS

GCD / NSOperationQueue EXC_BAD_ACCESS
As you are not using ARC, your stack variables are not initialized to 0/nil. Thus completionHandler(error, nil); will be called with random stack garbage for error. That was the one issue that stood out when looking through your code, and the clang static analyzer should easily catch that. I suggest you run the analyzer on your code and look at all the warnings. There may be other issues lurki

Categories : IOS

Can I animate my mapView like with SatNav
The only way to resolve this issue is import the Google maps framework, which works perfectly well alongside MKMapkit. There is a facility within Google Maps that enables the developer to animate their route.

Categories : IOS

How can I retrieve the value by parsing my XML file
I managed to solve this myself using the method below -(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string { if ((addRec) && (![string isEqualToString:@" "])) { NSArray *tmpArray = [[NSArray alloc] initWithObjects:string, nil]; if (polylineList.count > 0) [polylineList addObject:string]; else polylineList = [[NSM

Categories : IOS

setBarTintColor after view is loaded
If your fire the change of the navigationBarTinColor, It change automatically. You can test this, in any action: UINavigationBar *navBar = self.navigationController.navigationBar; [navBar setBarTintColor: [UIColor blueColor]]; Test this before in order to know that the problem is your method: UIColorFromRGB (in other order of things method should start with lower case). Another problem

Categories : IOS

Automatic adjustment of UIScrollView content offset with custom UIControl
It looks like this is handled by an internal private method that Apple utilizes [UIFieldEditor scrollSelectionToVisible] as noted on this blog: http://sugarrushva.my03.com/712423-disable-uiscrollview-scrolling-when-uitextfield-becomes-first-responder.html It appears to do this by stepping back up through the view hierarchy and if it finds a parent UIScrollView, it scrolls the view to bring the UI

Categories : IOS

Detect UILabel line break. Place items into UITableViewCell dynamically
You don't need to detect the line break to do this. You should use auto layout. You should set a vertical spacing constraint between the bottom of the top label and the top of the bottom label -- that will give them a fixed spacing no matter what size the labels expand to.

Categories : IOS

iOS Navigation Bar - I would like to set the title in Navigation bar with a dynamic value
Somewhere in your view controller code: self.navigationItem.title = [NSString stringWithFormat:@"Coffee (%d cups)", self.numberOfCupsOfCoffee]; Without more details, I can't be more precise.

Categories : IOS

'linker command failed', 'GenerateDSYMFile errors', and 'Lipo error'
As the error message indicates, you are trying to link a file into your executable that is not present on disk. Specifically, it is unable to find /Users/lbogdono/Library/Developer/Xcode/DerivedData/GraffitiFound-axmdvgkvpehlnwgtxecternwbifq/Build/Products/Debug-iphonesimulator/GraffitiFound.app/GraffitiFound I suspect you are trying to link that into the executable on accident as it doesn't rea

Categories : IOS

Setting NSManagedObject property stalls app... sometimes
This is a concurrency issue. In general, NSManagedObjects are not thread-safe. It means that you can only read and write their properties from a thread in which their NSManagedObjectContext was created, or in this context's private queue. You are accessing your managed objects in CD_QUEUE, so it's up to Grand Central Dispatch to decide in which thread this code will be executed. So there is a c

Categories : IOS

why scrollView.frame = CGRectMake() not work
The layout is done after viewDidLoad. You should also subclass viewDidLayoutSubviews and add your "custom" layout (ie. set view.frame) there.

Categories : IOS

Codesigning failed when building app from terminal
Try to build like this: security unlock-keychain -p aPassword /Users/aUser/Library/Keychains/login.keychain && xcodebuild -scheme 'aScheme' Release archive CODE_SIGN_IDENTITY="AcodeSignIdentity" PROVISIONING_PROFILE="aProvisioningProfile" Especially note the 1) Keychain unlock (unnecessary if you can unlock from the gui) 2) The use of a scheme

Categories : IOS

View presented by UINavigationController embedded in UITabBarController doesn't size view to account for tabBar at bottom of view
In IB, if you select your view controller, and look at the "View Controller" section in the Attributes Inspector, you will see that the default is for the view to be "Under Top Bars", and "Under Bottom Bars". If you don't want that behavior, then deselect one or both of those boxes. The code equivalent of this is the edgesForExtendedLayout property of UIViewController.

Categories : IOS

App Groups and iCloud in iOS
If you're already using iCloud, you don't need to use app groups, because your extension can access the same iCloud container as your app does. As long as your entitlements and provisioning are configured correctly, you can literally just use the same Core Data stack setup in the extension as in the app. Apple's Lister demo project does this, but there's nothing special about it. Just use iCloud

Categories : IOS


Recently Add
Graph API Error Domain=com.facebook.sdk Code=5
How do I use touch to only move my object in the y-coordinate?
Adding data from datePicker to table view
why there is a inset in tableviewcell's contentView when using xib and auto layout?
How to correctly implement protocol - delegate pattern between UIViewController and UIView in Swift
MagicalRecord several truncates, "then cannot find data for a temporary oid"
Swift - selectRowAtIndexPath not working with indexPathForSelectedRows
Hide UITableView search bar by default
How can I set the collection cell width to dynamic stretch to phone width
Tableview cell separating line disappears when tapped
Not appearing all level after SKTransition
How to transform a line during pan gesture event?
Nib View not showing menu or navigation bar
Can't unpause SKScene after adding a label
Automatic decompresion of gzipped json response data not working
Parse.com relation object specify order
How can I debounce a method call?
How to set/get a value in a multilevel dictionary?
Distinct UITableViewCell / UICollectionViewCell metrics between iPhone 6 Plus and all other smaller screens
After receiving notification on the lock screen and entering Passcode, the user is not taken to the app
When trying to build DisplayCandy, the terminal gives me this error
Asserting properties in a custom NSMutableArray
Regulating Flow of Dropbox Datastore Sync and Delta Size Error
iTMSTransporter upload behavior
Extract "alert" text from push notification
Xcode Debugger Crashes (Xcode 6.1 / LLDB / Yosemite)
Set App to run on iPhone 5+
Emulate a table cell without needing a UITableView (re-using standard iOS UI)
No clock displayed on presented Interface Controllers
adding cocoapod dependencies to a cocoa touch framework
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.