[Solved] How to save image from NSData after doing the action of appendData?

Here is the Sample: CGSize newSize = CGSizeMake({Here give width}, {Here give height}); UIImage *myFinalImage1 = [[UIImage alloc] initWithData:concatenatedData]; UIImage *myFinalImage2 = [[UIImage alloc] initWithData:concatenatedData]; // Set up width height with values. CGSize newSize = CGSizeMake(width, height); UIGraphicsBeginImageContext( newSize ); [myFinalImage1 drawInRect:CGRectMake(0,0,newSize.width,newSize.height)]; [myFinalImage2 drawInRect:CGRectMake(newSize.width,newSize.height,newSize.width,newSize.height*2) blendMode:kCGBlendModeNormal alpha:1.0]; UIImage *mergedImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); 2 solved How to … Read more

[Solved] How to browse the document file in iOS [closed]

Two things you can consider: 1. If you have to give permission for sharing document directory in your .plist. Then traverse through file app. 2. Or you have to use UIDocumentBrowserViewController and show list of file and directory. Please check this link : https://developer.apple.com/documentation/uikit/uidocumentbrowserviewcontroller 1 solved How to browse the document file in iOS [closed]

[Solved] How to parse JSON values using Swift 4?

Your code cannot work. According to the given JSON the root object is an array [[String: Any]] and there is no key result at all. let json = “”” [{“id”:1,”class”:”A”,”Place”:{“city”:”sando”,”state”:”CA”}},{“id”:1,”class”:”B”,”Place”:{“city”:”jambs”,”state”:”KA”}}] “”” let data = Data(json.utf8) do { if let json = try JSONSerialization.jsonObject(with: data) as? [[String: Any]] { for item in json { if let … Read more

[Solved] getting NSArray objects using index numbers

Try this : NSArray *arr = @[@”ECE”,@”CSE”,@”MECH”,@”CIVIL”,@”AERO”,@”IT”,@”EEE”,@”EM”]; NSArray *indexNumberArray = @[@0,@2,@5,@7]; NSMutableArray *arrNew = [NSMutableArray new]; for (NSNumber *index in indexNumberArray) { [arrNew addObject:[arr objectAtIndex:[index integerValue]]]; } Output 3 solved getting NSArray objects using index numbers

[Solved] non-void return value in void function table view

Welcome to SO. You are using a function, findObjectsInBackground, that takes a completion closure. The completion closure is another function inside your cellForRowAt function. That function holds onto (captures) the completion closure you pass in and doesn’t call it until the background call is complete. The block you pass in does not return a value. … Read more

[Solved] app crashes on iOS 9

Problem is solved. the above crash nothing to do with iOS 9 or Xcode 7. we were pushing the app through the MDM(Mobile device Management). MDM was doing a wrapping which was caused to this issue. this was identified by MDM support team. and its working now. Sorry that I hadn’t mentioned about MDM in … Read more

[Solved] How do I create delegates in Objective-C?

An Objective-C delegate is an object that has been assigned to the delegate property another object. To create one, you define a class that implements the delegate methods you’re interested in, and mark that class as implementing the delegate protocol. For example, suppose you have a UIWebView. If you’d like to implement its delegate’s webViewDidStartLoad: … Read more

[Solved] check the value of dictionary in array in swift [closed]

Imagine you downloaded some data from the server. You will convert the data into a dictionary using let arrayOfDictionaries = try! NSJSONSerialization.JSONObjectWithData( data, options: .AllowFragments ) var techNames : [String] = [] var adminNames : [String] = [] Then you can iterate doing for dictionary in arrayOfDictionaries { if dictionary[“department”] == “Technology” { // Add … Read more

[Solved] I cant display 3 cell in CollectionView [closed]

UICollectionViewDelegateFlowLayout func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath:NSIndexPath)->UICollectionViewCell { let cell = self.collectionView.dequeueReusableCell(withReuseIdentifier: “formCell”, for: indexPath) return cell } For number of item func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return 3 } For Get 3 cell in one row func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { let … Read more