spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
  Home » IOS » Page 5
Swift NSURLSession App crashes on cellular data
What you're doing is web scraping which is inherently unstable, particularly the way you're doing it. There is no guarantee that the content returned from that url will match up with the precise text you're using to break up the html. You've already found that you get different responses depending on the connection type. What if they restyle the page? Move to a service with a published API, or be

Categories : IOS

iOS : Using constraints to make 4s app look good on larger devices?
I think if you space your controls your app will simply look stretched up. Maybe it's useful for you, to define an top layout constraint and move your whole content a bit down or up depending on which device you are running. You can set up you constraints in Interface Builder and create a normal IBOutletto your constraint. Now in your viewDidLoad you can do stuff like if(self.view.bounds.size.h

Categories : IOS

IOS: How do I populate a UITableView which is within a nib?
Two things I can think of that might be missing: Set data source and delegate of the tableview to the controller; Call reload data method on the tableview to trigger a reload.

Categories : IOS

Changing background color of all views in project from one view controller?
that can be achieved by swizzeling in a class methode setter for the background into UIView. http://nshipster.com/method-swizzling/

Categories : IOS

Why window is nil in AppDelegate
You need to create the window yourself if not using the main interface option: window = UIWindow(frame:UIScreen.mainScreen().bounds) Then call your code above, using window. Finally, call makeKeyAndVisible() on the window.

Categories : IOS

Remove Edit button from navigation bar
search for and remove self.navigationItem.leftBarButtonItem = self.editButtonItem; if not then add self.navigationItem.leftBarButtonItem = nil;

Categories : IOS

Swift Xcode6 UIActivityIndicatorView Slow to display
Here is a code snippet: // get the background queue let bg_queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) dispatch_async(bg_queue, { // long running code here... dispatch_async(dispatch_get_main_queue(), { self.activityIndicator.stopAnimating() }) })

Categories : IOS

How to set the controller for a subview in storyboard?
You can add the object to yours main view controller, like in image: then, set in class in it settings: and set it like delegate and data source for yours collection view.

Categories : IOS

Rotating UIImage in Swift
'Extra argument in call' generally happens when one of the input types is incorrect. You can fix your code with var image = UIImage(CGImage: otherImage.CGImage, scale: CGFloat(1.0), orientation: .DownMirrored)

Categories : IOS

Tap or LongPress below cells
If you only want to be able to tap the empty areas of the table view, add a backgroundView to the table view. To that background view, add your gesture recognizer (remember to enable user interactions on the background view). When the gesture recognizer detects a tap, add a cell with an appropriate animation. Finally, check tableView.visibleCells.count to determine if your table view contains enou

Categories : IOS

MKLocalSearchRequest for all businesses
I'd say that given the fact that this is the case for naturalLanguageQuery: This property can not be nil. And no way is indicated to do a regex-based search, it's not possible. I'd check out another source of POI data for your task.

Categories : IOS

Best way to access WordPress and WooCommerce data for Apps
WooCommerce comes with a REST API There is also already a WooCommerce App for IOS.

Categories : IOS

Segues called from several areas not working
You can increment an integer property in the completion block of each animation, and inspect that value in the overridden setter for that property. In the following example, that property is called counter, and I had three animations that were triggered from buttons. I'm just showing the code for one button, but the code in the completion blocks is identical. -(void)setCounter:(NSInteger)counter

Categories : IOS

SortedArrayUsingSelector unrecognized Selector
The problems is this line: animals= [NSDictionary dictionaryWithObjectsAndKeys:_A,_B,_C,_D,_E,_F,_G,_H, nil]; When you create a dictionary with dictionaryWithObjectsAndKeys: the list of items you supply have to be objectA, keyA, objectB, keyB, objectC, keyC, nil. Right now it looks like all you have is objectA, objectB, objectC, nil. Which looks like this if you write it out: animals = @{@[@"B

Categories : IOS

How to design "ordering" of objects with Core Data
Use ordered relationship. It is mapped to NSOrderedSet.

Categories : IOS

Swift function completion
Given your definition of call_api_function, you would call it like so: call_api_function() { response in activityInd.stopAnimating() // now use `response` here } I'd suggest you do a little research on trailing closures in the The Swift Programming Language: Closures. But, having said that, your call_api_function has problems of its own. You're doing a forced unwrapping of the e

Categories : IOS

How can properties be updated in custom Section Header that was implemented via the storyboard?
I think, it good idea to for it on: - (void)scrollViewDidScroll:(UIScrollView)scrollView { } and, you should check, in which queue/thread are you call label update, it should be called only from main thread

Categories : IOS

Autolayout constraint on UIImageView in UITableViewCell
I faced the same problem while I had the accessory view in my tableview cell. The trick is to get the width of the contentView correct (to which the trailing space of the imageView is set). To achieve this do the following : In your Custom tableview cell's class, override the layoutSubviews method: - (void)layoutSubviews{ [super layoutSubviews]; self.contentView.frame = self.bounds; }

Categories : IOS

Variable width selection buttons on iOS
Your doubt is not entirely clear. If you are asking how to create buttons of variable width according to their text content, you can try the following : - (UIButton *)setupVariableWidthButton{ UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; button.layer.cornerRadius = 5.0f; button.layer.masksToBounds = YES; [button setBackgroundColor:[UIColor blueColor]];

Categories : IOS

Swift NSSet & CoreData
for aresponse in self.response.question.responses { // this next line throws an error var scoreVal = aresponse.score.integerValue The problem is that for aresponse in ... responses is iterating through an NSSet. Swift doesn't know what is in the NSSet, so it treats each value aresponse as an AnyObject, which has no properties. Thus, the compiler complains when you try to get the score pr

Categories : IOS

Post Request to alchemy API in iOS8
Change: NSString *post = [NSString stringWithFormat:@"&text=%@", appFile]; To: NSString *post = [NSString stringWithFormat:@"&text=%@", data]; It didn't occur to me to try this before posting the question because I had previous tried to do this but at that point I was sending the request with the GET method not the POST method.

Categories : IOS

iOS show notification when something had happen in background?
You could try something like this. This will schedule a local notification to fire at a set date and time (you need to provide the NSDate and message). ... NSDate *fireDate = // whatever date and time you want to fire the notification NSString alertMessage = @“Alert message!"; [self addNotification:fireDate mymessage:alertMessage]; ... -(void)addNotification:(NSDate *)mydate mymessage:(NSS

Categories : IOS

Determine when header sticks in UITableView
NSIndexPath has to members. section and row. The row member gives you zero information about what section you are in. All it does it tell you what row this path is in the given section, identified by the section member. We can determine what section an NSIndexPath belongs to by checking the section member: switch topCellPath.section { case 0: // top visible cell is in section 0

Categories : IOS

Memory warnings when trying to load 200+ images
Your memory management's the problem. Not Swift's. Here's where you went wrong... In your viewDidLoad method, you've instantiated your imageGroup array with 200+ images. Assuming these images aren't super tiny, you've already allocated a huge chunk of memory to an unnecessary array from the get go. You should instead fetch these images as needed during your loadImage method. For example, you can

Categories : IOS

CSS background issue on mobile Safari
I suggest that you use Media Queries to manipulate the look of your site for different resolutions. It is also recommended that you test your sites on actual devices and not on any simulator if that is the case. Here is a link on how to use Media Queries: http://www.w3schools.com/cssref/css3_pr_mediaquery.asp Regards

Categories : IOS

Detect tap only on main node/parent, not child nodes
Solved it setting the SKEmitterNode´s targetnode property to another node other than the one im detecting taps on. https://developer.apple.com/library/mac/Documentation/SpriteKit/Reference/SKEmitterNode_Ref/index.html#//apple_ref/occ/instp/SKEmitterNode/targetNode emitter.targetNode = self.scene

Categories : IOS

Delegate Error in Swift
I think you're getting your view and your viewcontroller mixed up: a ViewController controls things; a view just displays them. The viewController tells the view what to display. So, you want to connect your button to the viewController -- not the view. And you don't need a custom view class or a delegate. Set it up like this: create a textField and a button create an outlet for the textFie

Categories : IOS

DBRestClient.h not found for CDEDropboxCloudFileSystem (ensembles framework)
If it builds, your solution is probably fine. I guess whether you can import the framework header or not depends on how you are linking. Sounds like you are somehow linking a Dropbox framework on iOS. Is that right? That might be a new option Dropbox have added for iOS 8. Previously, on iOS, you basically linked with a static library, and then you don't have the option. Another way around the

Categories : IOS

iBeacon,a very strange thing with the UUID approach?
Every iBeacon has a factory UUID. Usually, all iBeacons from a manufacturer have the same UUID. For example, all Estimote iBeacons have the UUID B9407F30-F5F8-466E-AFF9-25556B57FE6D. Depending on manufacturers, provided SDK allow or don't allow UUID customization (most of them don't). I think apps listing ranged iBeacons use CoreBluetooth instead of CoreLocation. CB allow apps go get all ranged

Categories : IOS

Objective C: SpriteKit - wrong frame
With the help of AMI289 (see comments), we figured out how to repair this. First, I went to the project settings, and under General I removed the text from "Launch Screen File". Then, I added Launch Image Source. Afterwards, I removed the launch image set file and created new one. This made the menuImage fit the whole screen in correct resolution. Note: This might work only when using launch ima

Categories : IOS

How to update code when emulating Cordova app on Xcode?
With cordova 3.X you are not supposed to work with xcode Even if you are working with xcode, you have to run the cordova prepare ios command each time you change something. You can create a script (in xcode select the project, go to build phases, click the + button, and new run script phase). It should be over the copy www phase The code you need is: PATH=${PATH}:/usr/local/lib/node_modules/c

Categories : IOS

What part of the certificate creation process needs to remain the same for an iOS app?
As long as the bundle identifier is the same, it will be the same app in the store. The full bundle identifier consists of some hash for your Apple account + the identifier part in the project settings, usually something like: abc123.com.yourcompany.projectname

Categories : IOS

RestKit duplicates in cache
Using a cache on your FRC isn't likely to help, though it probably isn't the cause of this issue. I guess that you haven't configured a fetch request or in-memory managedObjectCache (to be used by RKManagedObjectStore) as this is the mechanism which allows RestKit to find existing items in the data store and update them instead of create new instances.

Categories : IOS

How to change uiview's height using auto layout?
On the Storyboard Page, click on your textview. Then click on the small triangular in the lower right corner. Click first on "Clear Constraints". An then on "Add Missing Constraints". Its the easiest way.

Categories : IOS

Apple LLVM 6.0 Error Clang 254
You can follow this example to solve this issue. It worked for me. You have to delete the derived data and the restart xCode. It always work with Apple LLVM 6.0 Error.

Categories : IOS

iOS Testflight "There was an error loading your builds."
after following a hint at the Apple developer forums, I was able to solve the issue on my side. https://devforums.apple.com/thread/255047?tstart=0 It seems you have to use version numbers with max one dot: X.XX Having multiple dots will result in the above error. So don't use X.XX.XX Another thing you should check is that you have the beta test entitlements in your distribution profile. This es

Categories : IOS

How Can I share image +text caption(URL) on whatsapp from iphone?
NSError *error = nil; NSURL *documentURL = [[NSFileManager defaultManager] URLForDirectory:NSDocumentDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:&error]; UIImage *image = [UIImage imageNamed:@"share.png"]; NSURL *tempFile = [documentURL URLByAppendingPathComponent:@"whatsAppTmp.wai"]; NSData *imageData = UIImageJPEGRepresentation(image, 1.0); NSS

Categories : IOS

iBeacon identifier value -why its not working?
Got it , if([self.locationManager respondsToSelector:@selector(requestAlwaysAuthorization)]) { [self.locationManager requestAlwaysAuthorization]; } Must be done first .

Categories : IOS

Pop view controller from Swift class in storyboard based iOS project
Ok I found a solution :) Solution: Instantiate my controller and give AppDelegate as argument: var window: UIWindow? var phController:PHController? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { self.phController = PHController(delegate:self) return true } Initializer of PHController: var delegate:App

Categories : IOS


Recently Add
keychain iOS touchId prompted twice
-[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x7fc748e37ea0'
Search Results Visibly Scrolling Underneath the Status Bar
How do I exclude an IOS 8 app extension from a build?
EXC_BAD_ACCESS when capturing a GPU frame
iOS 8 - Map keeps reanimating back to user location
Constantly refreshing background image of UIImageView IOS
UINavigationController keeps displaying popped view
Swift closure syntax using Shark Food Mute Switch?
MagicalRecord 3.0 not saving. No objects for the second build
iOS / Swift Can't add gesture to child class
iOS: Is there currently a way to prevent two view controllers being pushed or popped at the same time?
Checking if array contains two objects
How should turning of SCNLight affect background color?
Why don't my views show up in Storyboards and are greyed out in the left pane?
SWIFT convert NSTimeInteval to NSDate
BLE scanning is stopped when go to background?
Drawing a Rect on UIView
HLS playback via local HTTP server on iOS
Re-Assigning SKScene delegate protocol
Network lost on screen lock unlock
Annoying Xcode Error "file not found" #import
CoreData not firing faults
iOS:How do you change a view size/origin from another view controller class?
Changing a frame in viewDidLayoutSubviews
Animate multiple shapes in UIView
Add NSIntegers ONLY when 2nd NSInteger Changes Value
Facebook SDK, fetching friends
How to get Storyboard to support dynamically sized cells in UICollectionView?
GCD / NSOperationQueue EXC_BAD_ACCESS
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.