Click here to Skip to main content
15,892,697 members
Home / Discussions / Objective-C and Swift
   

Objective-C and Swift

 
QuestionHow to get the sensor data Pin
Member 1302743027-Feb-17 14:56
Member 1302743027-Feb-17 14:56 
AnswerRe: How to get the sensor data Pin
Richard MacCutchan27-Feb-17 21:22
mveRichard MacCutchan27-Feb-17 21:22 
Questionimage from custom NSView , image quality is very bad. Pin
Le@rner16-Jan-17 18:50
Le@rner16-Jan-17 18:50 
AnswerRe: image from custom NSView , image quality is very bad. Pin
Surya_Narayan10-Apr-17 23:31
professionalSurya_Narayan10-Apr-17 23:31 
GeneralRe: image from custom NSView , image quality is very bad. Pin
Le@rner11-Apr-17 22:17
Le@rner11-Apr-17 22:17 
QuestionSimultaneous Microphone Access on iPhone Pin
Member 123773388-Mar-16 0:35
Member 123773388-Mar-16 0:35 
QuestionObjective C first program from the book, warning messages Pin
Alla__10-Nov-15 1:44
Alla__10-Nov-15 1:44 
AnswerRe: Objective C first program from the book, warning messages Pin
BharathReddy V12-Jan-16 2:04
BharathReddy V12-Jan-16 2:04 
QuestionLinker command failed with exit code 1 (use -v to see invocation) in xcode 5.1.1 Pin
Member 1198376314-Sep-15 10:17
Member 1198376314-Sep-15 10:17 
QuestionImagePickerController image size Pin
liel333-Aug-15 11:30
liel333-Aug-15 11:30 
AnswerRe: ImagePickerController image size Pin
biji cabe18-Dec-16 22:25
biji cabe18-Dec-16 22:25 
QuestioniOS XMPP received message in coversation screen Pin
Member 1176696715-Jun-15 2:37
Member 1176696715-Jun-15 2:37 
SuggestionRe: iOS XMPP received message in coversation screen Pin
Richard MacCutchan15-Jun-15 4:19
mveRichard MacCutchan15-Jun-15 4:19 
GeneralRe: iOS XMPP received message in coversation screen Pin
Member 1176696715-Jun-15 20:42
Member 1176696715-Jun-15 20:42 
AnswerRe: iOS XMPP received message in coversation screen Pin
Dennis E White17-Jun-15 5:54
professionalDennis E White17-Jun-15 5:54 
Questionmake a system monitor using obj c. Pin
Member 116779679-May-15 13:00
Member 116779679-May-15 13:00 
AnswerRe: make a system monitor using obj c. Pin
Richard MacCutchan9-May-15 21:10
mveRichard MacCutchan9-May-15 21:10 
GeneralRe: make a system monitor using obj c. Pin
Dennis E White15-May-15 5:25
professionalDennis E White15-May-15 5:25 
GeneralRe: make a system monitor using obj c. Pin
Richard MacCutchan15-May-15 5:41
mveRichard MacCutchan15-May-15 5:41 
GeneralRe: make a system monitor using obj c. Pin
Dennis E White15-May-15 6:04
professionalDennis E White15-May-15 6:04 
GeneralApp that converts human years to dog years Pin
Member 115920608-Apr-15 15:44
Member 115920608-Apr-15 15:44 
GeneralRe: App that converts human years to dog years Pin
Dennis E White11-Apr-15 9:34
professionalDennis E White11-Apr-15 9:34 
GeneralRe: App that converts human years to dog years Pin
Richard MacCutchan11-Apr-15 22:05
mveRichard MacCutchan11-Apr-15 22:05 
GeneralRe: App that converts human years to dog years Pin
Dennis E White13-Apr-15 10:09
professionalDennis E White13-Apr-15 10:09 
QuestionCan anyone help me solve this project? Pin
Member 115772012-Apr-15 13:46
Member 115772012-Apr-15 13:46 
Declare and set a variable called myName to your name
Declare two more string variables introduction and japaneseIntroduction both with an NSString type
Set introduction using stringWithFormat class method "My name is %@", myName
Set japanese introduction using stringByAppendingString instance method by appending " to moushimasu"
Print introduction and japanese introduction
Step 3: Define and call a new function

Declare a function called printIntroductions
The function should accept an NSString as a parameter called name
Cut and paste the introduction and japaneseIntroduction code inside of the new function
You should have errors for referencing 'myName'. Change any reference to 'myName' to 'name'.
This is an error of scope. You only declared 'myName' in your didFinishLaunching method. Not in your new method. In your new method, you declared an argument called 'name' that your function accepts when the method is called
In your didFinishLaunching method after you set myName call printIntroductions: and pass in 'myName' as an argument
It should print out the introduction and Japanese introduction
Step 4: Recurse through a function

Add a new function called countDownTillIntroduction: that accepts an integer called numberOfDays as an argument
The function should do the following:
Check to see if the numberOfDays is 0
If the number of days is 0, it should print "The time has come"
If numberOfDays is not 0
It should print "[numberOfDays] days left until introductions"
It should declare and set a variable oneLessDay and set it to numberOfDays - 1
It should then call countDownTillIntroduction and pass in oneLessDay
In the didFinishLaunching method before you call printIntroductions call countDownTillIntroduction and pass in 4
Completion:

OUTPUT: You should see it print "4 days left until introductions", "3 days left until introductions" (down to 1) and then it should print "The time has come" and "My name is [yourName]", "[yourName] to moushimasu"

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.