iOS Development is easy with XCode, Swift3, UITableView, cocatouch, let's build iPhone, iPad and Macbook Applications.

Open TCP Socket with Objective-c

How to create a TCP socket using Objective-C, check if some TCP ports are opened on the server? I tried using some tutorials but none worked, because I need to create a server using an IP ( and not a site, such as, as some blog posts use. I’m a little confused about which […]

Storing NSObject using NSKeyedArchiver/ NSKeyedUnarchiver

I have a class object like; BookEntity.h import <Cocoa/Cocoa.h> @interface BookEntity : NSObject<NSCoding> { NSString *name; NSString *surname; NSString *email; } @property(copy) NSString *name,*surname,*email; @end BookEntity.m #import “BookEntity.h” @implementation BookEntity @synthesize name,surname,email; – (void) encodeWithCoder: (NSCoder *)coder { [coder encodeObject: self forKey:@”appEntity”]; } – (id) initWithCoder: (NSCoder *)coder { if (self = [super init]) { […]

Pass back data using , and reload data

View post on In the picture provided above, shows three view controllers. Let’s call the view controllers A, B, and C in the order they’re displayed. View Controller A passes parsed jSON data by clicking on the table cell. This fills up the “total sales, discounts, etc.” strings/labels inside of the View Controller B […]

Recognising a circle gesture to drop an annotation, how to detect circle?

I’ve found some code which detects a circle gesture anywhere in a view: It works fine. Now I want to incorporate it into a map view, so that the user can draw a circle, and a map pin gets dropped in the the middle of the drawn circle. The above code doesn’t work if […]

how to add images in UITableviewcells Programatically in ios

Hi I need to add different images in UITableViewCells programmatically. How can i do that.I am trying some code.But the images are not displayed in UITableViewCells. This is my code below. Please help me anybody. Thanks in advance. -(void)viewDidLoad { arrImages=[[NSMutableArray alloc]initWithObjects:@”image.png”,@”image2.png”,@”image3.png”,@”image4.png”,@”image5.png”,@”image6.png”,@”image7.png”,@”image8.png” nil]; } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *identifier=@”cell”; UITableViewCell *cell […]

How to find matching words in two separate strings?

If there are two separate strings, we need to retrieve all words that are matching (in those strings), in an array. also this matching should be case insensitive. What will be the most efficient way to achieve this. For Example: NSString *s1 = @”Hello there, I want to match similar words.”; NSString *s2 = @”Do […]

How can we allow our app to run when screen is locked

I have a problem with device locking. If my app is running and device gets locked then my app is also not working. I want my app to work even if my device is locked. My code is as follows: – (void)applicationDidEnterBackground:(UIApplication *)application { [[UIApplication sharedApplication] setIdleTimerDisabled:NO]; background = YES; UIApplication *app = [UIApplication sharedApplication]; […]

How to increase View size with UITextview?

I have made one sample demo ,When I type on UITextview it Will Expands but the view will not expand which is the super view of UITextview. Code – (void)textViewDidChange:(UITextView *)textView { CGFloat fixedWidth = textView.frame.size.width; CGSize newSize = [textView sizeThatFits:CGSizeMake(fixedWidth, MAXFLOAT)]; CGRect newFrame = textView.frame; newFrame.size = CGSizeMake(fmaxf(newSize.width, fixedWidth), newSize.height); textView.frame = newFrame; self.myTextView.scrollEnabled […]

How do Prevent a copy/paste/select popover on a UITextView using UIMenuController iOS5.1

The question: How do I prevent the copy/paste/select popup that occurs over a UITextView from appearing (not using UIwebView and css)? I did not want to go the rout of UIWebView as some posts have gone because I already am using UIViews with UITextFields for data entry. I had tried unsuccessfully to implement the solutions […]

How to send NSArray to web service

I have no success to send NSArray to web service. Service method is not called. But other service methods call works. Web service method is: [WebMethod] public int Method(IList items){… My array is full of objects Items: @interface Item : NSObject { double prop1; double prop2; double prop3; } @property double prop1; @property double prop2; […]