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

Objective-C and Swift

 
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
MemberMember 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
MemberMember 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"

AnswerRe: Can anyone help me solve this project? Pin
Sascha Lefèvre2-Apr-15 14:23
professionalSascha Lefèvre2-Apr-15 14:23 
AnswerRe: Can anyone help me solve this project? Pin
Dennis E White11-Apr-15 9:32
professionalDennis E White11-Apr-15 9:32 
AnswerRe: Can anyone help me solve this project? Pin
Peter Webb5-May-15 3:30
MemberPeter Webb5-May-15 3:30 
QuestionLaunch Safari from another app then Autofill username and password Pin
picardy8-Jan-15 8:45
Memberpicardy8-Jan-15 8:45 
AnswerRe: Launch Safari from another app then Autofill username and password Pin
Dennis E White27-Jan-15 5:11
professionalDennis E White27-Jan-15 5:11 
AnswerRe: Launch Safari from another app then Autofill username and password Pin
C3D130-Jan-15 3:46
professionalC3D130-Jan-15 3:46 
QuestionStart java program from Objective C code Pin
DraqueD5-Jan-15 8:42
MemberDraqueD5-Jan-15 8:42 
AnswerRe: Start java program from Objective C code Pin
jschell5-Jan-15 9:37
Memberjschell5-Jan-15 9:37 
GeneralRe: Start java program from Objective C code Pin
DraqueD5-Jan-15 9:52
MemberDraqueD5-Jan-15 9:52 
AnswerRe: Start java program from Objective C code Pin
Richard MacCutchan5-Jan-15 22:39
mveRichard MacCutchan5-Jan-15 22:39 
GeneralRe: Start java program from Objective C code Pin
DraqueD6-Jan-15 5:04
MemberDraqueD6-Jan-15 5:04 
GeneralRe: Start java program from Objective C code Pin
Richard MacCutchan6-Jan-15 5:29
mveRichard MacCutchan6-Jan-15 5:29 
GeneralRe: Start java program from Objective C code Pin
DraqueD6-Jan-15 5:43
MemberDraqueD6-Jan-15 5:43 
GeneralRe: Start java program from Objective C code Pin
Richard MacCutchan6-Jan-15 6:29
mveRichard MacCutchan6-Jan-15 6:29 
GeneralRe: Start java program from Objective C code Pin
DraqueD6-Jan-15 9:29
MemberDraqueD6-Jan-15 9:29 
AnswerRe: Start java program from Objective C code Pin
seemajoshii27-Feb-15 1:22
Memberseemajoshii27-Feb-15 1:22 
QuestionHow do I find Objective C developers? Pin
Waffleapp13-Dec-14 7:13
MemberWaffleapp13-Dec-14 7:13 

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.