last day (15 days later) » 

1:26 PM
0
Q: How to append UIImages from Camera into an array

FloI have a UITableView with few rows. When I LongPress on a row then a menu will pop-up and I will be able to open the camera to take a picture. I've created an array of Albums which contains an array of Photos. I want for each row to save that captured pictures into my array of Photos. When I try ...

 
Where have you added values to albumPhotos array?
 
Flo
See edit. albumPhotos[lastIndexPath.row].imagesPath?.append(nameOfPhot‌​o)
 
In this like you apeend string to imagesPath array. Where do you append value to albumPhotos array which is type of [AlbumPhotos]
 
Flo
Yes. I need to append the name of the photos into that array. But I can't manage to do that. Is crashing when I try to append.
 
Why do you have 10 rows? What do you want to achieve? Do you have image of desired output?
 
Flo
1:26 PM
Is just a small demo of my app. I have 10 rows for test. I try to achieve to add the name of the pictures for each row in each array of Photos. That's it.
 
When you have 0 images, you should have 0 cells isn't?
 
Flo
Yes. But this functionality is in my main project. All the checks.
 
Change var albumPhotos: [AlbumPhotos] = [] to var albumPhotos: [String] = []
 
Flo
This small project from GitHub is just a demo with my issue.
I was thinking to change it to var albumPhotos: AlbumPhotos?
 
Why you need this class AlbumPhotos
that makes no sense
 
Flo
1:30 PM
To pass the object to another VC
 
you can use array of string
can you send me the github link
 
Flo
Yes
Is there in the post
 
1:58 PM
hi
showing 10 cells with title "name of the album" isn't good practice
 
Flo
2:20 PM
Hi. This is just for test. In my main project I add each row using a button. Then I Tap on cell and I add pictures to that cell.
 

last day (15 days later) »