Posts

Change the screenshot location in MAC

Solution: Goto terminal and type the following command. $ defaults write com.apple.screencapture location After that open the folder that you want to choose ... Drag and drop the folder after that location. type enter finally your screen shot location changed.. enjoy....

Draw an uncompleted circle in iOS Objective C

Solution:         CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];         CGContextAddArc(context, x, y, 10 , 0 , 260 , YES); Use the context to add the arc.Use the arc function and pass the parameters that had x position,y position,start angle,end angle.

Remove the UIButton target's in swift or objective C

Solution: Use the below code to remove the targets for an UIButton. Objective C: [myButton removeTarget: nil             action:NULL             forControlEvents:UIControlEventAllEvents]; Swift 2:          myBtn.removeTarget( nil , action: nil , forControlEvents: .AllEvents) Swift 3:         myBtn.removeTarget( nil , action: nil , for: .allEvents)

How to get the current device language in iOS swift and objective C?

Solution: You can get the device language like(English,french) using the below code. Objective C:          N SString *l anguage = [[[NSBundle m ainBundle] p referredLocalizations] o bjectAtIndex: 0 ]; Swift:         let language = Bundle . main . preferredLocalizations . first a s ! NSString

DIfference between @import and #import

Solution: It's new feature module.In #import it's must be add the framework in framework.In advanced version we can use the @import for all modules like third party framework also.. In previous version we are using # import <Cocoa/Cocoa.h> In current version @ i mport Cocoa

How to write dispatch after GCD in iOS swift?

Solution: Using GCD below are the three methods after few milliseconds or microseconds or nanoseconds.         DispatchQueue . main . asyncAfter (deadline: . now () + . milliseconds ( 500 )) {             print ( "after milliseconds" )         }                  DispatchQueue . main . asyncAfter (deadline: . now () + . microseconds ( 1000 )) {             print ( "after microseconds" )         }                  DispatchQueue . main . asyncAfter (deadline: . now () + . nanoseconds ( 10000000 )) {             print ( "after nano seconds" )         }

“Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.” when using GCC IOS issue

Problem: When try to compile my c program the below error shows.   gcc mythread.c -o mythread “Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.” when using GCC Solution: Just open the xcode and it will show the notification that want to agree the new user agreement.First accept that and continue the procedure after that run your code it will works good...