Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLC-iOS
Commits
6e376241
Commit
6e376241
authored
Oct 23, 2015
by
Felix Paul Kühne
Browse files
LAN server sync: fix previous commit
parent
e7ad674a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Sources/LocalNetworkConnectivity/VLCNetworkLoginViewController.m
View file @
6e376241
...
...
@@ -76,6 +76,11 @@
self
.
edgesForExtendedLayout
=
UIRectEdgeNone
;
}
-
(
void
)
dealloc
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
}
-
(
void
)
viewWillAppear
:(
BOOL
)
animated
{
[
super
viewWillAppear
:
animated
];
...
...
@@ -97,6 +102,12 @@
[
self
protocolSelectionChanged
:
nil
];
}
NSNotificationCenter
*
notificationCenter
=
[
NSNotificationCenter
defaultCenter
];
[
notificationCenter
addObserver
:
self
selector:
@selector
(
ubiquitousKeyValueStoreDidChange
:)
name:
NSUbiquitousKeyValueStoreDidChangeExternallyNotification
object:
[
NSUbiquitousKeyValueStore
defaultStore
]];
NSUbiquitousKeyValueStore
*
ukvStore
=
[
NSUbiquitousKeyValueStore
defaultStore
];
[
ukvStore
synchronize
];
_serverList
=
[
NSMutableArray
arrayWithArray
:[
ukvStore
arrayForKey
:
kVLCStoredServerList
]];
...
...
@@ -137,8 +148,16 @@
-
(
void
)
viewWillDisappear
:(
BOOL
)
animated
{
[
super
viewWillDisappear
:
animated
];
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
[
defaults
setObject
:
_serverList
forKey
:
kVLCStoredServerList
];
NSUbiquitousKeyValueStore
*
ukvStore
=
[
NSUbiquitousKeyValueStore
defaultStore
];
[
ukvStore
setArray
:
_serverList
forKey
:
kVLCStoredServerList
];
[
ukvStore
synchronize
];
}
-
(
void
)
ubiquitousKeyValueStoreDidChange
:(
NSNotification
*
)
notification
{
/* TODO: don't blindly trust that the Cloud knows best */
_serverList
=
[
NSMutableArray
arrayWithArray
:[[
NSUbiquitousKeyValueStore
defaultStore
]
arrayForKey
:
kVLCStoredServerList
]];
[
self
.
storedServersTableView
reloadData
];
}
-
(
IBAction
)
connectToServer
:(
id
)
sender
...
...
Sources/VLCOpenNetworkStreamViewController.m
View file @
6e376241
...
...
@@ -57,7 +57,6 @@
[
super
viewDidLoad
];
NSNotificationCenter
*
notificationCenter
=
[
NSNotificationCenter
defaultCenter
];
[
notificationCenter
addObserver
:
self
selector:
@selector
(
ubiquitousKeyValueStoreDidChange
:)
name:
NSUbiquitousKeyValueStoreDidChangeExternallyNotification
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment