These are chat archives for devslopes/swiftios9

18th
Nov 2015
rodrynet
@rodrynet
Nov 18 2015 00:08
Welcome @timmyqtpie
Sketchy Swift
@HardcoreIOS
Nov 18 2015 00:09
@rodrynet lol
@timmyqtpie Indeed
Evan Leong
@evanmayo
Nov 18 2015 00:11
welcome @timmyqtpie !
Felix Barros
@BluePhoenix
Nov 18 2015 00:14
Oh man, I come back from work, and there are lots of new people now. Cool. :P Welcome
@andrew-buksha Have you tried doing a Clean and then a Build?
(Product > Clean then Product > Build)
CBusMB
@CBusMB
Nov 18 2015 01:01
Hello. I cannot get my project to build after adding Firebase. I've tried everything shown as a solution on Stack Overflow (setting Build Active Architecture to no, etc...). Screenshot below.
![alt]http://i.imgur.com/nCahrjm.png
Mark Price
@spentak
Nov 18 2015 01:26
Is this one of your own projects?
Paste the code from your Podfile
CBusMB
@CBusMB
Nov 18 2015 01:30

yes, using your lesson as a template to add to my own project.

Uncomment this line to define a global platform for your project

platform :ios, '8.0'

Uncomment this line if you're using Swift

use_frameworks!

target 'Thank You, Friends' do
pod 'Firebase', '>= 2.4.2'
end

target 'Thank You, FriendsTests' do

end

target 'Thank You, FriendsUITests' do

I just now changed the settings again, and am now getting a different error though

end

The new error is:
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't open file list file: /Users/matthewbrown/Library/Developer/Xcode/DerivedData/Thank_You,_Friends-ghuwmumuftcywzepmvofqjqbgqev/Build/Intermediates/Pods.build/Debug-iphonesimulator/Pods-Thank You (No such file or directory)

Mark Price
@spentak
Nov 18 2015 02:39
Hmm. You might want to delete your Derived Data folder. I think its in ComputerUserName->Library->Developer->Xcode->Derived Data
then reload
if that still doesn't work im really not sure. You may want to re-install Xcode or something. Or uninstall cocoapods and reinstall
CBusMB
@CBusMB
Nov 18 2015 02:40
yes, have deleted derived data several times. will try reinstall. thanks.
CBusMB
@CBusMB
Nov 18 2015 03:57
Reinstalled, started new project. Copied all files from old project to new, added FacebookSDK, added Firebase Cocoapod. It builds. Back on track, thank you. Great course by the way.
Rohit Gupta
@rohitcricket
Nov 18 2015 04:46
I am in section 8. I placed UIImage and label on the UICollection View, but when I run and app, I neither see the image nor the label. I removed them and redid everything, but still cannot see the image and label. What am I doing wrong? Thank you!
Mark Price
@spentak
Nov 18 2015 05:38
@rohitcricket when you open the assistant editor and open Preview mode do you see your cell and label? If not your constraints are probably not set correctly
or perhaps your collection view is not tied to the IBOutlet
kasra1989
@kasra1989
Nov 18 2015 05:38
hi.....
Mark Price
@spentak
Nov 18 2015 05:38
@kasra1989 welcome!
kasra1989
@kasra1989
Nov 18 2015 05:38
---swift
swift
sorryyy.. i just wanna exam something
Mark Price
@spentak
Nov 18 2015 05:39
haha wrong key
top left
the tick key
under esc
kasra1989
@kasra1989
Nov 18 2015 05:39
yea..thanx
class Point {
    var x = 0.0 // sets the default value of x to 0
    var y = 0.0 // sets the default value of x to 0
}
thanx a lot
i just test it
Mark Price
@spentak
Nov 18 2015 06:10
Prototyping a new chat client (Discord) that has more features. Feel free to join us. Nothing official yet. https://discord.gg/0eJQ7YrHTEtR8R00
Kyle Lee
@Kilo-Loco
Nov 18 2015 08:10
@spentak hey Mark, I was just wondering if NSURLSession could have been used for the pokedex app? If so, what's the benefit of using Alamofire over NSURLSession?
andrew-buksha
@andrew-buksha
Nov 18 2015 13:22
@BluePhoenix thank you, didn't think about cleaning. It helped me.
Mark Price
@spentak
Nov 18 2015 15:00
@Kilo-Loco yes. Alamofire just provides convenience. Write less code.
Mark Price
@spentak
Nov 18 2015 17:20
Everyone should start using the guard statement http://ericcerney.com/swift-guard-statement/
Kyle Lee
@Kilo-Loco
Nov 18 2015 17:26
@spentak it's funny that you say that. I found the same article https://twitter.com/kilo_loco/status/651981143122665472
Mark Price
@spentak
Nov 18 2015 17:27
i didn't cover it in the course but its important. should probably add a video on it
Tim McEwan
@timmyqtpie
Nov 18 2015 17:27
This message was deleted
Mark Price
@spentak
Nov 18 2015 17:29
crazy you can post tweets here!
Kyle Lee
@Kilo-Loco
Nov 18 2015 19:52
@spentak thanks for the Twitter link, just watched it and thought it was awesome. Also, I'm trying to log into my devslopes account but I must have entered a wrong password during registration cuz nothing works. Ive tried resetting the password but haven't received an email.. Can you help? Username: Kilo-Loco Email: kyle@kiloloco.com
Mark Price
@spentak
Nov 18 2015 19:53
@Kilo-Loco account for what? The community site?
Kyle Lee
@Kilo-Loco
Nov 18 2015 19:54
@spentak yes the community site devslopes.com
*community.devslopes.com
Mark Price
@spentak
Nov 18 2015 19:55
hmm not sure how to reset your password. Its NodeBB forum tool. I can delete your account and you can re-sign up
ok deleted
try again
Jack Davis
@jackd942
Nov 18 2015 19:59
I had that same problem the other day…wound up fixing it by deleting my cache/cookies and a reboot.
it kept sayint “forbidden” every time I would try to log in
Kyle Lee
@Kilo-Loco
Nov 18 2015 20:14
@spentak thanks mark that worked!
rodrynet
@rodrynet
Nov 18 2015 22:00
Hi! more doubts... i was thinking if it´s possible to ask to the user for a email and then send an email without showing the MFMailViewController?
Mark Price
@spentak
Nov 18 2015 22:03
@rodrynet you can't use the native mail app to do this - but if you have a mail service with an API you can
rodrynet
@rodrynet
Nov 18 2015 22:06
great! Thank you @spentak :smile:
Rohit Gupta
@rohitcricket
Nov 18 2015 22:08
@spentak Thank you! I see the image in the 'preview' mode but not when I run the app.
Leykoo
@dimaleyko
Nov 18 2015 22:49
Hi.
Mark Price
@spentak
Nov 18 2015 22:49
hi @dimaleyko
Leykoo
@dimaleyko
Nov 18 2015 22:49
For some reason I got an error in my firs exercise.
Jack Davis
@jackd942
Nov 18 2015 22:49
Hi @dimaleyko
Leykoo
@dimaleyko
Nov 18 2015 22:50
The app crashes on launch.
'''
Kyle Lee
@Kilo-Loco
Nov 18 2015 22:51
@dimaleyko at any time did you delete anything in your view controller?
Leykoo
@dimaleyko
Nov 18 2015 22:51

'''import UIKit

class ViewController: UIViewController {
@IBOutlet weak var blue: UIImageView!
@IBOutlet weak var red: UIImageView!
@IBOutlet weak var blueButton: UIButton!
@IBOutlet weak var redButton: UIButton!

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

@IBAction func hideBlue(sender: AnyObject) {
    blue.hidden = false
}
@IBAction func hideRed(sender: AnyObject) {
    red.hidden = false
}

}
'''

Mark Price
@spentak
Nov 18 2015 22:52
@dimaleyko perhaps your views in your storyboard are not connected to your IBOutlets
Leykoo
@dimaleyko
Nov 18 2015 22:52
They are, I have checked.
Mark Price
@spentak
Nov 18 2015 22:52
which line of code is the crash on
Leykoo
@dimaleyko
Nov 18 2015 22:53
Thing is it just gives this error: 2015-11-18 22:53:06.698 S2-E1[42512:1787034] Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<S2_E1.ViewController 0x7ffef309b7f0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key RED.' First throw call stack:
(
0 CoreFoundation 0x000000010c7e7f45 exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010e50bdeb objc_exception_throw + 48
2 CoreFoundation 0x000000010c7e7b89 -[NSException raise] + 9
3 Foundation 0x000000010cbb0a6b -[NSObject(NSKeyValueCoding) setValue:forKey:] + 288
4 UIKit 0x000000010d18f04c -[UIViewController setValue:forKey:] + 88
5 UIKit 0x000000010d3bca71 -[UIRuntimeOutletConnection connect] + 109
6 CoreFoundation 0x000000010c728a80 -[NSArray makeObjectsPerformSelector:] + 224
7 UIKit 0x000000010d3bb454 -[UINib instantiateWithOwner:options:] + 1864
8 UIKit 0x000000010d195c16 -[UIViewController _loadViewFromNibNamed:bundle:] + 381
9 UIKit 0x000000010d196542 -[UIViewController loadView] + 178
10 UIKit 0x000000010d1968a0 -[UIViewController loadViewIfRequired] + 138
11 UIKit 0x000000010d197013 -[UIViewController view] + 27
12 UIKit 0x000000010d07051c -[UIWindow addRootViewControllerViewIfPossible] + 61
13 UIKit 0x000000010d070c05 -[UIWindow _setHidden:forced:] + 282
14 UIKit 0x000000010d0824a5 -[UIWindow makeKeyAndVisible] + 42
15 UIKit 0x000000010cffc396 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4131
16 UIKit 0x000000010d0029c3 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1750
17 UIKit 0x000000010cfffba3 -[UIApplication workspaceDidEndTransaction:] + 188
18 FrontBoardServices 0x000000011039a784 -[FBSSerialQueue _performNext] + 192
19 FrontBoardServices 0x000000011039aaf2 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
20 CoreFoundation 0x000000010c714011
CFRUNLOOPISCALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
21 CoreFoundation 0x000000010c709f3c CFRunLoopDoSources0 + 556
22 CoreFoundation 0x000000010c7093f3
CFRunLoopRun + 867
23 CoreFoundation 0x000000010c708e08 CFRunLoopRunSpecific + 488
24 UIKit 0x000000010cfff4f5 -[UIApplication _run] + 402
25 UIKit 0x000000010d00430d UIApplicationMain + 171
26 S2-E1 0x000000010c60a41d main + 109
27 libdyld.dylib 0x000000010f01392d start + 1
28 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Mark Price
@spentak
Nov 18 2015 22:53
yeah you have the problem i mentioned
do this
Leykoo
@dimaleyko
Nov 18 2015 22:54
oh
Mark Price
@spentak
Nov 18 2015 22:54
1) open your storyboard
2) right click the view controller icon at the top left
3) you will likely see a yellow warning sign or a missing connection
Leykoo
@dimaleyko
Nov 18 2015 22:55
That is strange cause the code says it is connected and that says it is not
Mark Price
@spentak
Nov 18 2015 22:56
yeah the code file is never usually correct. sometimes it looks connected sometimes not
Leykoo
@dimaleyko
Nov 18 2015 22:56
Oh ok, Thanks a lot!
cool it works
Kyle Lee
@Kilo-Loco
Nov 18 2015 22:57
@dimaleyko that can also happen if you connected an outlet but then deleted and connected it to a different one. In which case it would be connected on the VC but the storyboard would still have 1 missing connection
Leykoo
@dimaleyko
Nov 18 2015 22:58
Oh I see
yeah I have deleted one of the things after connecting it
Thanks
Kyle Lee
@Kilo-Loco
Nov 18 2015 22:59
@dimaleyko any time
Tim McEwan
@timmyqtpie
Nov 18 2015 23:03
Voila_Capture 2015-11-18_04-03-17_PM.png
Any idea how to reuse buttons? So i can make the images re appear once i click it again.
Kyle Lee
@Kilo-Loco
Nov 18 2015 23:08
@timmyqtpie there are 2 ways but the one I'm more familiar with is to make an @IBOutlet in addition to you @IBAction and then set set your @IBOutlet to hidden
So for your case blueCallOUTLET.hidden = true
Tim McEwan
@timmyqtpie
Nov 18 2015 23:13
So i have to make two buttons one for hiding my images and two for making it reappear? I mean i can do that I am just wondering if there is a better way?
Kyle Lee
@Kilo-Loco
Nov 18 2015 23:19
Ohhh i think i misunderstood. So you want to hide the button then make it reappear?
Tim McEwan
@timmyqtpie
Nov 18 2015 23:19
yup
exactly
Kyle Lee
@Kilo-Loco
Nov 18 2015 23:21
Alright what I did with my code was made a global variable could counter. This could be called anything. what you want to do is set up a function where it turns on and off your buttons or images when its pressed and adds 1 to the counter. So this is what you do

var counter = 0

fun hideShow() {
if counter % 2 == 0 {
btnOutlet.hidden = true
counter++
} else {
btnOutlet.hidden = false
counter++
}
}

Kyle Lee
@Kilo-Loco
Nov 18 2015 23:27
sorry i don't know how to make it look like code on here
and then you just call that function in your button when its pressed
Tim McEwan
@timmyqtpie
Nov 18 2015 23:29
thanks for you're help
Kyle Lee
@Kilo-Loco
Nov 18 2015 23:31
@timmyqtpie yea no problem. does that explanation make sense?
you can also use my source code as a reference
Tim McEwan
@timmyqtpie
Nov 18 2015 23:37
@Kilo-Loco thats pretty cool thanks for sharing that. Crazy that there is like a billions ways to do one thing.
Kyle Lee
@Kilo-Loco
Nov 18 2015 23:40
Thats whats awesome about programming is that its basically what way YOU come up with to solve a problem
However the code i showed you isn't completely optimized since it is my first project but it shows everything in a very readable way
Tim McEwan
@timmyqtpie
Nov 18 2015 23:41
I understand thanks
Kyle Lee
@Kilo-Loco
Nov 18 2015 23:44
don't forget to make the switch https://discord.gg/0eJQ7YrHTEuVHmKG
Tim McEwan
@timmyqtpie
Nov 18 2015 23:46
whats that?
Sketchy Swift
@HardcoreIOS
Nov 18 2015 23:49
A new room @timmyqtpie
Mark Price
@spentak
Nov 18 2015 23:51
We'll be migrating to Discord over time
Jack Davis
@jackd942
Nov 18 2015 23:57
+1
Tim McEwan
@timmyqtpie
Nov 18 2015 23:58
Guys thats amazing :)